From 5e3678f71fe40074ced07b82cf4bf7f1933feea1 Mon Sep 17 00:00:00 2001 From: Kevin Provance Date: Tue, 25 May 2021 15:13:16 -0400 Subject: [PATCH 01/11] image_select 'selected' fix. Signed-off-by: Kevin Provance --- .../image_select/class-redux-image-select.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/redux-core/inc/fields/image_select/class-redux-image-select.php b/redux-core/inc/fields/image_select/class-redux-image-select.php index cd830f6b..345bcd3c 100644 --- a/redux-core/inc/fields/image_select/class-redux-image-select.php +++ b/redux-core/inc/fields/image_select/class-redux-image-select.php @@ -78,12 +78,12 @@ public function render() { $the_value = $k; - $selected = ( '' !== checked( $this->value, $the_value, false ) ) ? ' redux-image-select-selected' : ''; - if ( ! empty( $this->field['tiles'] ) && true === $this->field['tiles'] ) { $the_value = $v['img']; } + $selected = ( '' !== checked( $this->value, $the_value, false ) ) ? ' redux-image-select-selected' : ''; + $presets = ''; $is_preset = false; @@ -201,7 +201,7 @@ public function enqueue() { * * @param string $data css string. * - * @return string|void + * @return string */ public function css_style( $data ) { $css = ''; @@ -212,7 +212,12 @@ public function css_style( $data ) { if ( ! empty( $data ) && ! is_array( $data ) ) { switch ( $mode ) { case 'background-image': - $img = isset( $this->field['options'][ $data ]['img'] ) ? $this->field['options'][ $data ]['img'] : ''; + if ( $this->field['tiles'] ) { + $img = $data; + } else { + $img = $this->field['options'][ $data ]['img'] ?? ''; + } + if ( '' !== $img ) { $output = "background-image: url('" . esc_url( $img ) . "');"; } From d63193a4c2a1929f1c3f37df88c7a3a02f7b9789 Mon Sep 17 00:00:00 2001 From: Kevin Provance Date: Tue, 25 May 2021 15:17:48 -0400 Subject: [PATCH 02/11] Added 'footer' tag to color output for twenty-twenty demo. Signed-off-by: Kevin Provance --- sample/sections/color-selection/color.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample/sections/color-selection/color.php b/sample/sections/color-selection/color.php index 0a18af7f..fb167435 100644 --- a/sample/sections/color-selection/color.php +++ b/sample/sections/color-selection/color.php @@ -35,7 +35,7 @@ 'subtitle' => esc_html__( 'Pick a background color for the footer (default: #dd9933).', 'your-textdomain-here' ), 'default' => '#dd9933', 'validate' => 'color', - 'output' => array( '.footer' ), + 'output' => array( '.footer footer' ), ), ), ) From a45c25b2e3f669cabf6b325571f8e28932ca0455 Mon Sep 17 00:00:00 2001 From: Kevin Provance Date: Tue, 25 May 2021 15:18:29 -0400 Subject: [PATCH 03/11] #208 - Added 'footer' tag to color output for twenty-twenty demo. Signed-off-by: Kevin Provance --- sample/sections/color-selection/color.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample/sections/color-selection/color.php b/sample/sections/color-selection/color.php index fb167435..a245802f 100644 --- a/sample/sections/color-selection/color.php +++ b/sample/sections/color-selection/color.php @@ -35,7 +35,7 @@ 'subtitle' => esc_html__( 'Pick a background color for the footer (default: #dd9933).', 'your-textdomain-here' ), 'default' => '#dd9933', 'validate' => 'color', - 'output' => array( '.footer footer' ), + 'output' => array( '.footer footer #site-footer' ), ), ), ) From df7974ade00c405ce325b71326f6ab0160c735e4 Mon Sep 17 00:00:00 2001 From: Kevin Provance Date: Tue, 25 May 2021 15:19:21 -0400 Subject: [PATCH 04/11] #207 - radio (and presumably others) not showing data when using 'get_wordpress_data' after save and refresh. Signed-off-by: Kevin Provance --- redux-core/inc/classes/class-redux-wordpress-data.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/redux-core/inc/classes/class-redux-wordpress-data.php b/redux-core/inc/classes/class-redux-wordpress-data.php index 4a79ff60..6611eabf 100644 --- a/redux-core/inc/classes/class-redux-wordpress-data.php +++ b/redux-core/inc/classes/class-redux-wordpress-data.php @@ -41,12 +41,13 @@ public function __construct( $parent = null ) { * * @param bool $type Type. * @param array $args Args. + * @param array $opt_name Opt name. * @param string|int $current_value Current value. * @param bool $ajax Tells if this is a AJAX call. * * @return array|mixed|string */ - public function get( $type = false, $args = array(), $current_value = '', $ajax = false ) { + public function get( $type = false, $args = array(), $opt_name = '', $current_value = '', $ajax = false ) { $opt_name = $this->opt_name; // We don't want to run this, it's not a string value. Send it back! From 3c004f7290799e6e81fc33da01c2e5204f2bc851 Mon Sep 17 00:00:00 2001 From: Kevin Provance Date: Tue, 25 May 2021 15:21:00 -0400 Subject: [PATCH 05/11] #207 - radio (and presumably others) not showing data when using 'get_wordpress_data' after save and refresh. Signed-off-by: Kevin Provance --- redux-core/inc/fields/radio/class-redux-radio.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/redux-core/inc/fields/radio/class-redux-radio.php b/redux-core/inc/fields/radio/class-redux-radio.php index f2966606..84a8a421 100644 --- a/redux-core/inc/fields/radio/class-redux-radio.php +++ b/redux-core/inc/fields/radio/class-redux-radio.php @@ -43,11 +43,11 @@ public function render() { foreach ( $this->field['options'] as $k => $v ) { echo '
  • '; echo '