Skip to content

Commit f44073b

Browse files
authoredSep 15, 2023
Merge pull request #661 from analogwp/release-v2.0.6
Release v2.0.6
2 parents ac9ac02 + 4a9de98 commit f44073b

File tree

6 files changed

+200
-163
lines changed

6 files changed

+200
-163
lines changed
 

‎analogwp-templates.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@
1010
* Plugin Name: Style Kits for Elementor
1111
* Plugin URI: https://analogwp.com/
1212
* Description: Style Kits extends the Elementor theme styles editor with more global styling options. Boost your design workflow in Elementor with intuitive global controls and theme style presets.
13-
* Version: 2.0.5
13+
* Version: 2.0.6
1414
* Author: AnalogWP
1515
* Author URI: https://analogwp.com/
1616
* License: GPL2
1717
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
1818
* Text Domain: ang
19-
* Elementor tested up to: 3.14.1
20-
* Elementor Pro tested up to: 3.14.1
19+
* Elementor tested up to: 3.16.3
20+
* Elementor Pro tested up to: 3.16.1
2121
*/
2222

2323
defined( 'ABSPATH' ) || exit;
2424

2525
define( 'ANG_ELEMENTOR_MINIMUM', '3.5.0' );
2626
define( 'ANG_PHP_MINIMUM', '7.0' );
2727
define( 'ANG_WP_MINIMUM', '5.9' );
28-
define( 'ANG_VERSION', '2.0.5' );
28+
define( 'ANG_VERSION', '2.0.6' );
2929
define( 'ANG_PLUGIN_FILE', __FILE__ );
3030
define( 'ANG_PLUGIN_URL', plugin_dir_url( ANG_PLUGIN_FILE ) );
3131
define( 'ANG_PLUGIN_DIR', plugin_dir_path( ANG_PLUGIN_FILE ) );

‎inc/Database_Upgrader.php

+11
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function init() {
3737
'1.7.2' => 'upgrade_1_7_2',
3838
'2.0.0' => 'upgrade_2_0',
3939
'2.0.5' => 'upgrade_2_0_5',
40+
'2.0.6' => 'upgrade_2_0_6',
4041
);
4142

4243
$version = get_option( self::OPTION, '0.0.0' );
@@ -171,4 +172,14 @@ protected function upgrade_2_0_5() {
171172
// Regenerate Elementor CSS.
172173
Utils::clear_elementor_cache();
173174
}
175+
176+
/**
177+
* Regenerate CSS for migrated container spacing styles.
178+
*
179+
* @return void
180+
*/
181+
protected function upgrade_2_0_6() {
182+
// Regenerate Elementor CSS.
183+
Utils::clear_elementor_cache();
184+
}
174185
}

‎inc/elementor/class-typography.php

+32-15
Original file line numberDiff line numberDiff line change
@@ -416,16 +416,33 @@ public function register_container_spacing( Controls_Stack $element, $section_id
416416
)
417417
);
418418

419+
$no_padding_styles = array(
420+
'{{WRAPPER}} .elementor-repeater-item-ang_container_no_padding.elementor-element' => '--padding-block-start: 0px; --padding-inline-end: 0px; --padding-block-end: 0px; --padding-inline-start: 0px;',
421+
);
422+
423+
$padding_preset_styles = array(
424+
'{{WRAPPER}} {{CURRENT_ITEM}}.elementor-element' => '--padding-block-start: {{TOP}}{{UNIT}}; --padding-inline-end: {{RIGHT}}{{UNIT}}; --padding-block-end: {{BOTTOM}}{{UNIT}}; --padding-inline-start: {{LEFT}}{{UNIT}}',
425+
);
426+
427+
// Backwards compatibility with v3.15.3 and lower.
428+
if ( Utils::is_elementor_pre( '3.16.0' ) ) {
429+
$no_padding_styles = array(
430+
'{{WRAPPER}} .elementor-repeater-item-ang_container_no_padding.elementor-element' => '--padding-top: 0px; --padding-right: 0px; --padding-bottom: 0px; --padding-left: 0px;',
431+
);
432+
433+
$padding_preset_styles = array(
434+
'{{WRAPPER}} {{CURRENT_ITEM}}.elementor-element' => '--padding-top: {{TOP}}{{UNIT}}; --padding-right: {{RIGHT}}{{UNIT}}; --padding-bottom: {{BOTTOM}}{{UNIT}}; --padding-left: {{LEFT}}{{UNIT}}',
435+
);
436+
}
437+
419438
// Hack for adding no padding styles at container presets.
420439
$element->add_control(
421440
'ang_container_no_padding_hidden',
422441
array(
423442
'label' => __( 'No Padding Styles', 'ang' ),
424443
'type' => Controls_Manager::HIDDEN,
425444
'default' => 'no',
426-
'selectors' => array(
427-
'{{WRAPPER}} .elementor-repeater-item-ang_container_no_padding.elementor-element' => '--padding-top: 0px; --padding-right: 0px; --padding-bottom: 0px; --padding-left: 0px;',
428-
),
445+
'selectors' => $no_padding_styles,
429446
)
430447
);
431448

@@ -580,9 +597,7 @@ public function register_container_spacing( Controls_Stack $element, $section_id
580597
'unit' => 'px',
581598
),
582599
'size_units' => array( 'px', 'em', '%', 'rem', 'vw', 'custom' ),
583-
'selectors' => array(
584-
'{{WRAPPER}} {{CURRENT_ITEM}}.elementor-element' => '--padding-top: {{TOP}}{{UNIT}}; --padding-right: {{RIGHT}}{{UNIT}}; --padding-bottom: {{BOTTOM}}{{UNIT}}; --padding-left: {{LEFT}}{{UNIT}}',
585-
),
600+
'selectors' => $padding_preset_styles,
586601
'global' => array(
587602
'active' => false,
588603
),
@@ -1218,6 +1233,7 @@ public function tweak_section_padding_control( Element_Base $element ) {
12181233
* @param Element_Base $element Element_Base Class.
12191234
*/
12201235
public function tweak_container_widget( Element_Base $element ) {
1236+
12211237
if ( ! Utils::is_elementor_container() ) { // Return early if Flexbox container is not active.
12221238
return;
12231239
}
@@ -1231,7 +1247,7 @@ public function tweak_container_widget( Element_Base $element ) {
12311247

12321248
// Register default options array.
12331249
$options = array(
1234-
'none' => __( 'Default', 'ang' ),
1250+
'default_padding' => __( 'Default', 'ang' ),
12351251
'ang_container_no_padding' => __( 'No Padding', 'ang' ),
12361252
);
12371253

@@ -1274,13 +1290,14 @@ public function tweak_container_widget( Element_Base $element ) {
12741290
$element->add_control(
12751291
'ang_container_spacing_size',
12761292
array(
1277-
'label' => __( 'Spacing Preset', 'ang' ),
1278-
'description' => sprintf( '<a href="#" class="ang-notice blue" onClick="%1$s">%2$s</a>', "analog.redirectToPanel( 'ang_container_spacing' )", __( 'Edit in Style Kits', 'ang' ) ),
1279-
'type' => Controls_Manager::SELECT,
1280-
'hide_in_inner' => true,
1281-
'default' => 'none',
1282-
'options' => $options,
1283-
'prefix_class' => 'elementor-repeater-item-',
1293+
'label' => __( 'Spacing Preset', 'ang' ),
1294+
'description' => sprintf( '<a href="#" class="ang-notice blue" onClick="%1$s">%2$s</a>', "analog.redirectToPanel( 'ang_container_spacing' )", __( 'Edit in Style Kits', 'ang' ) ),
1295+
'type' => Controls_Manager::SELECT,
1296+
'hide_in_inner' => false,
1297+
'default' => 'default_padding',
1298+
'options' => $options,
1299+
'prefix_class' => 'elementor-repeater-item-',
1300+
'frontend_available' => true,
12841301
)
12851302
);
12861303

@@ -1320,7 +1337,7 @@ public function tweak_container_widget_styles( Element_Base $element ) {
13201337
'label' => __( 'Background presets', 'ang' ),
13211338
'description' => sprintf( '<a href="#" class="ang-notice blue" onClick="%1$s">%2$s</a>', 'analog.openThemeStyles()', 'Edit in Style Kits' ),
13221339
'type' => Controls_Manager::SELECT,
1323-
'hide_in_inner' => true,
1340+
'hide_in_inner' => false,
13241341
'default' => 'none',
13251342
'options' => $bg_presets,
13261343
'prefix_class' => 'sk-',

0 commit comments

Comments
 (0)