Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Commit cb1062c

Browse files
authored
Merge pull request #218 from svl-studios/master
4.1.27 fixes.
2 parents 9a2a3bd + b01810a commit cb1062c

17 files changed

+70
-24
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Redux Changelog
22

3+
## 4.1.27
4+
* Fixed: Image select not selecting default value.
5+
* Modified: #209 - Link color field overridden by theme. Added 'important' arg to the output array to fix. See sample config.
6+
* Fixed: #208 - Same config not setting footer background in Twenty-twenty theme due to incorrect class.
7+
* Fixed: #207 - Radio field not displaying text after save/refresh when displaying WordPress data.
8+
* Modified: #210 - Donation text removed.
9+
* Fixed: #206 - Link color CSS compiling incorrectly due to late escaping.
10+
311
## 4.1.26
412
* Added: Menu accent introduced in WordPress 5.7.
513
* Updated: ACE Editor 1.4.12.

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reduxframework/redux-framework-4",
3-
"version": "4.1.26",
3+
"version": "4.1.27",
44
"authors": [
55
{
66
"name": "Redux.io",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"main": "gulpfile.js",
44
"name": "redux",
55
"author": "Redux.io + Dōvy Paukstys",
6-
"version": "4.1.26",
6+
"version": "4.1.27",
77
"license": "GPL-3.0-or-later",
88
"repository": {
99
"type": "git",

readme.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: gutenberg, blocks, gutenberg blocks, editor, block, page builder, block ed
55
Requires at least: 4.0
66
Requires PHP: 7.1
77
Tested up to: 5.7.2
8-
Stable tag: 4.1.26
8+
Stable tag: 4.1.27
99
License: GPL-2.0+
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
1111

@@ -154,6 +154,14 @@ If you want, you can use the [Gutenberg](https://wordpress.org/plugins/gutenberg
154154

155155
== Changelog ==
156156

157+
== 4.1.27 ==
158+
* Fixed: Image select not selecting default value.
159+
* Modified: #209 - Link color field overridden by theme. Added 'important' arg to the output array to fix. See sample config.
160+
* Fixed: #208 - Same config not setting footer background in Twenty-twenty theme due to incorrect class.
161+
* Fixed: #207 - Radio field not displaying text after save/refresh when displaying WordPress data.
162+
* Modified: #210 - Donation text removed.
163+
* Fixed: #206 - Link color CSS compiling incorrectly due to late escaping.
164+
157165
== 4.1.26 ==
158166
* Added: Menu accent introduced in WordPress 5.7.
159167
* Updated: ACE Editor 1.4.12.

redux-core/assets/css/redux-fields.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

redux-core/assets/css/redux-fields.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

redux-core/framework.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
require_once dirname( __FILE__ ) . '/class-redux-core.php';
2525

26-
Redux_Core::$version = '4.1.26';
26+
Redux_Core::$version = '4.1.27';
2727
Redux_Core::$redux_path = dirname( __FILE__ );
2828
Redux_Core::instance();
2929

redux-core/inc/classes/class-redux-cdn.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private static function enqueue( $handle, $src_cdn, $deps, $ver, $footer_or_medi
9393
* @param mixed $footer_or_media True or 'all'.
9494
* @param bool $is_script Script or style.
9595
*/
96-
private static function cdn( bool $register, string $handle,string $src_cdn,array $deps,string $ver,?string $footer_or_media,bool $is_script ) {
96+
private static function cdn( bool $register, string $handle, string $src_cdn, array $deps, string $ver, $footer_or_media, bool $is_script ) {
9797
$tran_key = '_style_cdn_is_up';
9898
if ( $is_script ) {
9999
$tran_key = '_script_cdn_is_up';
@@ -167,7 +167,7 @@ private static function cdn( bool $register, string $handle,string $src_cdn,arra
167167
* @param mixed $footer_or_media True or 'all'.
168168
* @param bool $is_script Script or style.
169169
*/
170-
private static function vendor_plugin( bool $register, string $handle, string $src_cdn, array $deps, string $ver, ?string $footer_or_media, bool $is_script ) {
170+
private static function vendor_plugin( bool $register, string $handle, string $src_cdn, array $deps, string $ver, $footer_or_media, bool $is_script ) {
171171
if ( class_exists( 'Redux_VendorURL' ) ) {
172172
$src = Redux_VendorURL::get_url( $handle );
173173

redux-core/inc/classes/class-redux-field.php

+7
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,13 @@ public function output( $style = '' ) {
259259
$this->field['compiler'] = array( $this->field['compiler'] );
260260
}
261261

262+
if ( isset( $this->field['compiler']['important'] ) ) {
263+
if ( $this->field['compiler']['important'] ) {
264+
$style = str_replace( ';', ' !important;', $style );
265+
}
266+
unset( $this->field['compiler']['important'] );
267+
}
268+
262269
if ( ! empty( $this->field['compiler'] ) && is_array( $this->field['compiler'] ) ) {
263270
$keys = implode( ',', $this->field['compiler'] );
264271
$this->parent->compilerCSS .= $keys . '{' . $style . '}';

redux-core/inc/classes/class-redux-helpers.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ public static function google_fonts_array( $download = false ) {
16831683

16841684
if ( ! file_exists( $path ) || ( file_exists( $path ) && $download && self::google_fonts_update_needed() ) ) {
16851685
if ( $download ) {
1686-
$url = 'http://api.redux.io/gfonts';
1686+
$url = apply_filter( 'redux/typography/google_fonts/url', 'https://api.redux.io/gfonts' );
16871687

16881688
$request = wp_remote_get(
16891689
$url,

redux-core/inc/classes/class-redux-wordpress-data.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ public function __construct( $parent = null ) {
4141
*
4242
* @param bool $type Type.
4343
* @param array $args Args.
44+
* @param array $opt_name Opt name.
4445
* @param string|int $current_value Current value.
4546
* @param bool $ajax Tells if this is a AJAX call.
4647
*
4748
* @return array|mixed|string
4849
*/
49-
public function get( $type = false, $args = array(), $current_value = '', $ajax = false ) {
50+
public function get( $type = false, $args = array(), $opt_name = '', $current_value = '', $ajax = false ) {
5051
$opt_name = $this->opt_name;
5152

5253
// We don't want to run this, it's not a string value. Send it back!
@@ -155,7 +156,7 @@ public function get( $type = false, $args = array(), $current_value = '', $ajax
155156
*
156157
* @return array
157158
*/
158-
private function process_results( $results = array(), $id_key = '', $name_key = '', $add_key = true, $secondary_key = 'slug' ) {
159+
private function process_results( array $results = array(), $id_key = '', $name_key = '', bool $add_key = true, $secondary_key = 'slug' ): array {
159160
$data = array();
160161
if ( ! empty( $results ) && ! is_a( $results, 'WP_Error' ) ) {
161162
foreach ( $results as $k => $v ) {

redux-core/inc/fields/image_select/class-redux-image-select.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ public function render() {
7878

7979
$the_value = $k;
8080

81-
$selected = ( '' !== checked( $this->value, $the_value, false ) ) ? ' redux-image-select-selected' : '';
82-
8381
if ( ! empty( $this->field['tiles'] ) && true === $this->field['tiles'] ) {
8482
$the_value = $v['img'];
8583
}
8684

85+
$selected = ( '' !== checked( $this->value, $the_value, false ) ) ? ' redux-image-select-selected' : '';
86+
8787
$presets = '';
8888
$is_preset = false;
8989

@@ -201,7 +201,7 @@ public function enqueue() {
201201
*
202202
* @param string $data css string.
203203
*
204-
* @return string|void
204+
* @return string
205205
*/
206206
public function css_style( $data ) {
207207
$css = '';
@@ -212,7 +212,12 @@ public function css_style( $data ) {
212212
if ( ! empty( $data ) && ! is_array( $data ) ) {
213213
switch ( $mode ) {
214214
case 'background-image':
215-
$img = isset( $this->field['options'][ $data ]['img'] ) ? $this->field['options'][ $data ]['img'] : '';
215+
if ( $this->field['tiles'] ) {
216+
$img = $data;
217+
} else {
218+
$img = $this->field['options'][ $data ]['img'] ?? '';
219+
}
220+
216221
if ( '' !== $img ) {
217222
$output = "background-image: url('" . esc_url( $img ) . "');";
218223
}

redux-core/inc/fields/link_color/class-redux-link-color.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ public function output( $style = '' ) {
272272
if ( ! empty( $this->field['output'] ) && is_array( $this->field['output'] ) ) {
273273
$style_string = '';
274274

275+
if ( isset( $this->field['output']['important'] ) ) {
276+
if ( $this->field['output']['important'] ) {
277+
$style = str_replace( ';', ' !important;', $style );
278+
}
279+
unset( $this->field['output']['important'] );
280+
}
281+
275282
foreach ( $style as $key => $value ) {
276283
if ( is_numeric( $key ) ) {
277284
$style_string .= implode( ',', $this->field['output'] ) . '{' . $value . '}';
@@ -316,6 +323,13 @@ public function output( $style = '' ) {
316323
if ( ! empty( $this->field['compiler'] ) && is_array( $this->field['compiler'] ) ) {
317324
$style_string = '';
318325

326+
if ( isset( $this->field['compiler']['important'] ) ) {
327+
if ( $this->field['compiler']['important'] ) {
328+
$style = str_replace( ';', ' !important;', $style );
329+
}
330+
unset( $this->field['compiler']['important'] );
331+
}
332+
319333
foreach ( $style as $key => $value ) {
320334
if ( is_numeric( $key ) ) {
321335
$style_string .= implode( ',', $this->field['compiler'] ) . '{' . $value . '}';
@@ -333,7 +347,7 @@ public function output( $style = '' ) {
333347
}
334348
}
335349
}
336-
$this->parent->compilerCSS .= esc_attr( $style_string );
350+
$this->parent->compilerCSS .= $style_string;
337351
}
338352
}
339353
}

redux-core/inc/fields/radio/class-redux-radio.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ public function render() {
4343
foreach ( $this->field['options'] as $k => $v ) {
4444
echo '<li>';
4545
echo '<label for="' . esc_attr( $this->field['id'] . '_' . array_search( $k, array_keys( $this->field['options'] ), true ) ) . '">';
46-
echo '<input
47-
type="radio"
48-
class="radio ' . esc_attr( $this->field['class'] ) . '"
49-
id="' . esc_attr( $this->field['id'] . '_' . array_search( $k, array_keys( $this->field['options'] ), true ) ) . '"
50-
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '"
46+
echo '<input
47+
type="radio"
48+
class="radio ' . esc_attr( $this->field['class'] ) . '"
49+
id="' . esc_attr( $this->field['id'] . '_' . array_search( $k, array_keys( $this->field['options'] ), true ) ) . '"
50+
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '"
5151
value="' . esc_attr( $k ) . '" ' . checked( $this->value, $k, false ) . '/>';
5252

5353
echo ' <span>' . esc_html( $v ) . '</span>';

redux-framework.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Description: Build better sites in WordPress fast
1111
* Author: Redux.io + Dovy Paukstys
1212
* Author URI: http://redux.io
13-
* Version: 4.1.26
13+
* Version: 4.1.27
1414
* Text Domain: redux-framework
1515
* License: GPLv3 or later
1616
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt

sample/sections/color-selection/color.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
'subtitle' => esc_html__( 'Pick a background color for the footer (default: #dd9933).', 'your-textdomain-here' ),
3636
'default' => '#dd9933',
3737
'validate' => 'color',
38-
'output' => array( '.footer' ),
38+
'output' => array( '.footer footer #site-footer' ),
3939
),
4040
),
4141
)

sample/sections/color-selection/link-color.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
'hover' => '#bbb',
2828
'active' => '#ccc',
2929
),
30-
'output' => 'a',
30+
'output' => array(
31+
'a',
32+
'important' => true,
33+
),
3134

3235
// phpcs:ignore Squiz.PHP.CommentedOutCode
3336
// 'regular' => false, // Disable Regular Color.

0 commit comments

Comments
 (0)