From ad8d125e15a2b423dbe63895c43685bb47edb63f Mon Sep 17 00:00:00 2001 From: Krishna Kant Chourasiya Date: Fri, 6 Dec 2024 17:55:29 +0530 Subject: [PATCH 1/7] Move Button Sizes out of Legacy to Active panels --- assets/css/sk-components.css | 17 ----------------- inc/class-elementor.php | 3 +-- inc/elementor/class-typography.php | 11 ++++------- 3 files changed, 5 insertions(+), 26 deletions(-) diff --git a/assets/css/sk-components.css b/assets/css/sk-components.css index cc68448a..3028c3f7 100644 --- a/assets/css/sk-components.css +++ b/assets/css/sk-components.css @@ -1156,23 +1156,6 @@ /** * Legacy features */ - -.elementor-control.elementor-control-ang_buttons { - margin-top: 40px; -} - -.elementor-control.elementor-control-ang_buttons::before { - content: " "; - width: 100%; - height: 1px; - display: block; - background: #000; - opacity: 0.1; - top: -20px; - position: absolute; -} - -.elementor-control.elementor-control-ang_buttons .elementor-control-content::after, .elementor-control.elementor-control-ang_section_padding .elementor-control-content::after, .elementor-control.elementor-control-ang_column_gaps .elementor-control-content::after, .elementor-control.elementor-control-ang_colors .elementor-control-content::after { diff --git a/inc/class-elementor.php b/inc/class-elementor.php index 8eb01eef..cc779573 100644 --- a/inc/class-elementor.php +++ b/inc/class-elementor.php @@ -147,8 +147,7 @@ public function enqueue_editor_scripts() { if ( $is_legacy_hidden ) { wp_add_inline_style( 'analogwp-components-css', - '.elementor-control.elementor-control-ang_buttons, - .elementor-control.elementor-control-ang_section_padding, + '.elementor-control.elementor-control-ang_section_padding, .elementor-control.elementor-control-ang_column_gaps, .elementor-control.elementor-control-ang_colors { display: none !important; diff --git a/inc/elementor/class-typography.php b/inc/elementor/class-typography.php index 225c9943..a9c991fe 100644 --- a/inc/elementor/class-typography.php +++ b/inc/elementor/class-typography.php @@ -74,10 +74,10 @@ public function __construct() { add_action( 'elementor/element/kit/section_buttons/after_section_end', array( $this, 'register_typography_sizes' ), 30, 2 ); add_action( 'elementor/element/after_section_end', array( $this, 'register_styling_settings' ), 20, 2 ); + add_action( 'elementor/element/kit/section_buttons/after_section_end', array( $this, 'register_buttons' ), 40, 2 ); add_action( 'elementor/element/kit/section_buttons/after_section_end', array( $this, 'register_tools' ), 270, 2 ); - // Legacy features ( Button Sizes, Outer Section Padding and Column Gaps ) - deprecated to be removed. - add_action( 'elementor/element/kit/section_buttons/after_section_end', array( $this, 'register_buttons' ), 275, 2 ); + // Legacy features ( Outer Section Padding and Column Gaps ) - deprecated to be removed. add_action( 'elementor/element/kit/section_buttons/after_section_end', array( $this, 'register_outer_section_padding' ), 280, 2 ); add_action( 'elementor/element/kit/section_buttons/after_section_end', array( $this, 'register_columns_gap' ), 290, 2 ); @@ -104,9 +104,7 @@ public function __construct() { add_action( 'elementor/element/heading/section_title/after_section_end', array( $this, 'add_typo_helper_link' ), 999, 2 ); - if ( Utils::is_elementor_pre( '3.20.0' ) ) { - add_action( 'elementor/element/button/section_button/after_section_end', array( $this, 'add_btn_sizes_helper_link' ), 999, 2 ); - } + add_action( 'elementor/element/button/section_button/after_section_end', array( $this, 'add_btn_sizes_helper_link' ), 999, 2 ); add_action( 'elementor/element/kit/section_buttons/after_section_end', array( $this, 'register_shadows' ), 47, 2 ); @@ -822,8 +820,7 @@ public function register_buttons( Controls_Stack $element, $section_id ) { 'ang_buttons_description', array( 'raw' => sprintf( - '%1$s
%2$s %4$s', - __( 'Heads-up! This is a legacy feature, no longer supported in Elementor.', 'ang' ), + '%1$s %3$s', __( 'Define the default styles for every button size.', 'ang' ), 'https://analogwp.com/docs/button-sizes/', __( 'Learn more.', 'ang' ) From 2e59a1f37b6629e356e8ecc24dad2c30cbb491fc Mon Sep 17 00:00:00 2001 From: Krishna Kant Chourasiya Date: Fri, 6 Dec 2024 17:55:52 +0530 Subject: [PATCH 2/7] Reset and enable Button Size control at Buttons --- inc/elementor/class-typography.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/inc/elementor/class-typography.php b/inc/elementor/class-typography.php index a9c991fe..2cf3c6f3 100644 --- a/inc/elementor/class-typography.php +++ b/inc/elementor/class-typography.php @@ -2439,6 +2439,17 @@ public function add_typo_helper_link( Element_Base $element ) { * @param Element_Base $element Element_Base Class. */ public function add_btn_sizes_helper_link( Element_Base $element ) { + // Check and reset the condition to none at size control. + $size_control = $element->get_controls( 'size' ); + if ( $size_control ) { + $element->update_control( + 'size', + [ + 'condition' => [], + ] + ); + }; + $element->start_injection( array( 'of' => 'size', From 5fe6d6e66b09ce47b5eb48b174ac890555895f28 Mon Sep 17 00:00:00 2001 From: Krishna Kant Chourasiya Date: Fri, 6 Dec 2024 18:02:50 +0530 Subject: [PATCH 3/7] Reset and enable Heading size control --- inc/elementor/class-typography.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/inc/elementor/class-typography.php b/inc/elementor/class-typography.php index 2cf3c6f3..322f772a 100644 --- a/inc/elementor/class-typography.php +++ b/inc/elementor/class-typography.php @@ -2410,6 +2410,17 @@ public function tweak_container_borders( Element_Base $element ) { * @param Element_Base $element Element_Base Class. */ public function add_typo_helper_link( Element_Base $element ) { + // Check and reset the condition to none at size control. + $size_control = $element->get_controls( 'size' ); + if ( $size_control ) { + $element->update_control( + 'size', + [ + 'condition' => [], + ] + ); + }; + $element->start_injection( array( 'of' => 'size', From 1be5ece3b1528f21efb54303519a0753d8d50aa7 Mon Sep 17 00:00:00 2001 From: Krishna Kant Chourasiya Date: Fri, 6 Dec 2024 18:30:08 +0530 Subject: [PATCH 4/7] Remove newsletter form --- assets/js/admin-settings.js | 36 ---------------------- inc/settings/views/html-admin-settings.php | 9 ------ 2 files changed, 45 deletions(-) diff --git a/assets/js/admin-settings.js b/assets/js/admin-settings.js index 27faf0c4..3272d935 100644 --- a/assets/js/admin-settings.js +++ b/assets/js/admin-settings.js @@ -4,42 +4,6 @@ const { __ } = wp.i18n; const { addQueryArgs } = wp.url; - // Process Newsletter. - function processNewsletter( e ) { - if ( e.preventDefault ) { - e.preventDefault(); - } - const elSubmitBtn = $( '#ang-newsletter-submit' ); - let status = __( 'Subscribing', 'ang' ); - const angEmail = $( '#ang-newsletter-email' ).val(); - elSubmitBtn.text( status ); - - $.ajax( { - url: 'https://analogwp.com/?ang-api=asdf&request=subscribe_newsletter', - cache: ! 1, - type: 'POST', - dataType: 'JSON', - data: { - email: angEmail, - }, - error: function() { - status = __( 'Failed', 'ang' ); - elSubmitBtn.text( status ); - setTimeout( function() { - elSubmitBtn.text( __( 'Subscribe up to newsletter', 'ang' ) ); - }, 2000 ); - }, - success: function() { - status = __( 'Subscribed', 'ang' ); - elSubmitBtn.text( status ); - elSubmitBtn.attr( 'disabled', 'disabled' ); - }, - } ); - - return false; - } - $( '#ang-newsletter' ).submit( processNewsletter ); - // Process Plugin Rollback. function processPluginRollback( e ) { if ( e.preventDefault ) { diff --git a/inc/settings/views/html-admin-settings.php b/inc/settings/views/html-admin-settings.php index 37f754ea..c906cda9 100644 --- a/inc/settings/views/html-admin-settings.php +++ b/inc/settings/views/html-admin-settings.php @@ -91,15 +91,6 @@

-