Version Description
Redux instances returning null. Saved options now show on the front end.
Download this release
Release Info
Developer | dovyp |
Plugin | Redux Framework |
Version | 4.2.8 |
Comparing to | |
See all releases |
Code changes from version 4.2.7 to 4.2.8
- readme.txt +4 -1
- redux-core/framework.php +1 -1
- redux-core/inc/classes/class-redux-api.php +6 -6
- redux-core/inc/classes/class-redux-args.php +11 -26
- redux-core/inc/classes/class-redux-enqueue.php +7 -7
- redux-core/inc/classes/class-redux-field.php +5 -6
- redux-core/inc/classes/class-redux-instances.php +2 -2
- redux-framework.php +1 -1
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: gutenberg, blocks, gutenberg blocks, editor, block, page builder, block ed
|
|
4 |
Requires at least: 4.0
|
5 |
Requires PHP: 7.1
|
6 |
Tested up to: 5.8
|
7 |
-
Stable tag: 4.2.
|
8 |
License: GPL-3.0+
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
10 |
|
@@ -152,6 +152,9 @@ If you want, you can use the [Gutenberg](https://wordpress.org/plugins/gutenberg
|
|
152 |
|
153 |
== Changelog ==
|
154 |
|
|
|
|
|
|
|
155 |
= 4.2.7 =
|
156 |
Fixed: Options reverting or not saving.
|
157 |
|
4 |
Requires at least: 4.0
|
5 |
Requires PHP: 7.1
|
6 |
Tested up to: 5.8
|
7 |
+
Stable tag: 4.2.8
|
8 |
License: GPL-3.0+
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
10 |
|
152 |
|
153 |
== Changelog ==
|
154 |
|
155 |
+
= 4.2.8 =
|
156 |
+
Redux instances returning null. Saved options now show on the front end.
|
157 |
+
|
158 |
= 4.2.7 =
|
159 |
Fixed: Options reverting or not saving.
|
160 |
|
redux-core/framework.php
CHANGED
@@ -23,7 +23,7 @@ defined( 'ABSPATH' ) || exit;
|
|
23 |
|
24 |
require_once dirname( __FILE__ ) . '/class-redux-core.php';
|
25 |
|
26 |
-
Redux_Core::$version = '4.2.
|
27 |
Redux_Core::$redux_path = dirname( __FILE__ );
|
28 |
Redux_Core::instance();
|
29 |
|
23 |
|
24 |
require_once dirname( __FILE__ ) . '/class-redux-core.php';
|
25 |
|
26 |
+
Redux_Core::$version = '4.2.8';
|
27 |
Redux_Core::$redux_path = dirname( __FILE__ );
|
28 |
Redux_Core::instance();
|
29 |
|
redux-core/inc/classes/class-redux-api.php
CHANGED
@@ -197,9 +197,9 @@ if ( ! class_exists( 'Redux', false ) ) {
|
|
197 |
/**
|
198 |
* Retrieve all ReduxFramework Instances.
|
199 |
*
|
200 |
-
* @return array|ReduxFramework[]
|
201 |
*/
|
202 |
-
public static function all_instances(): array {
|
203 |
return Redux_Instances::get_all_instances();
|
204 |
}
|
205 |
|
@@ -926,9 +926,9 @@ if ( ! class_exists( 'Redux', false ) ) {
|
|
926 |
/**
|
927 |
* Create multiple fields of the option panel and apply to a section.
|
928 |
*
|
929 |
-
* @param string
|
930 |
-
* @param int|string
|
931 |
-
* @param array
|
932 |
*/
|
933 |
public static function set_fields( string $opt_name = '', $section_id = '', array $fields = array() ) {
|
934 |
if ( ! is_array( $fields ) || empty( $fields ) || '' === $opt_name || '' === $section_id ) {
|
@@ -1581,7 +1581,7 @@ if ( ! class_exists( 'Redux', false ) ) {
|
|
1581 |
/**
|
1582 |
* Gets all loaded extension for the passed ReduxFramework instance.
|
1583 |
*
|
1584 |
-
* @param string
|
1585 |
* @param object|null $instance ReduxFramework instance.
|
1586 |
*/
|
1587 |
public static function get_instance_extension( string $opt_name, $instance ) {
|
197 |
/**
|
198 |
* Retrieve all ReduxFramework Instances.
|
199 |
*
|
200 |
+
* @return null|array|ReduxFramework[]
|
201 |
*/
|
202 |
+
public static function all_instances(): ?array {
|
203 |
return Redux_Instances::get_all_instances();
|
204 |
}
|
205 |
|
926 |
/**
|
927 |
* Create multiple fields of the option panel and apply to a section.
|
928 |
*
|
929 |
+
* @param string $opt_name Panel opt_name.
|
930 |
+
* @param int|string $section_id Section ID this field belongs to.
|
931 |
+
* @param array $fields Array of field arrays.
|
932 |
*/
|
933 |
public static function set_fields( string $opt_name = '', $section_id = '', array $fields = array() ) {
|
934 |
if ( ! is_array( $fields ) || empty( $fields ) || '' === $opt_name || '' === $section_id ) {
|
1581 |
/**
|
1582 |
* Gets all loaded extension for the passed ReduxFramework instance.
|
1583 |
*
|
1584 |
+
* @param string $opt_name Panel opt_name.
|
1585 |
* @param object|null $instance ReduxFramework instance.
|
1586 |
*/
|
1587 |
public static function get_instance_extension( string $opt_name, $instance ) {
|
redux-core/inc/classes/class-redux-args.php
CHANGED
@@ -169,11 +169,10 @@ if ( ! class_exists( 'Redux_Args', false ) ) {
|
|
169 |
$args = $this->args( $args );
|
170 |
$args = $this->default_cleanup( $args );
|
171 |
|
172 |
-
if ( ! in_array( $args['font_display'], array( '
|
173 |
$args['font_display'] = 'swap';
|
174 |
}
|
175 |
-
|
176 |
-
if ( $args['async_typography'] ) {
|
177 |
$args['async_typography'] = false;
|
178 |
}
|
179 |
|
@@ -250,7 +249,7 @@ if ( ! class_exists( 'Redux_Args', false ) ) {
|
|
250 |
/**
|
251 |
* Sanitize args that should not be empty.
|
252 |
*
|
253 |
-
* @param
|
254 |
*
|
255 |
* @return array
|
256 |
*/
|
@@ -297,7 +296,7 @@ if ( ! class_exists( 'Redux_Args', false ) ) {
|
|
297 |
/**
|
298 |
* Shims for much older v3 configs.
|
299 |
*
|
300 |
-
* @param
|
301 |
*
|
302 |
* @return array
|
303 |
*/
|
@@ -337,16 +336,9 @@ if ( ! class_exists( 'Redux_Args', false ) ) {
|
|
337 |
if ( is_array( $arr ) && ! empty( $arr ) ) {
|
338 |
foreach ( $arr as $x => $y ) {
|
339 |
if ( strpos( Redux_Core::strtolower( $y ), 'redux' ) !== false ) {
|
340 |
-
$msg = '<strong>' . esc_html__(
|
341 |
-
'Redux Framework
|
342 |
-
'redux-framework'
|
343 |
-
) . ' </strong>' . esc_html__(
|
344 |
-
'There are references to the Redux Framework support site in your config\'s ',
|
345 |
-
'redux-framework'
|
346 |
-
) . '<code>admin_bar_links</code> ' . esc_html__(
|
347 |
-
'argument. This is sample data. Please change or remove this data before shipping your product.',
|
348 |
-
'redux-framework'
|
349 |
-
);
|
350 |
|
351 |
$this->omit_items = true;
|
352 |
break;
|
@@ -361,16 +353,9 @@ if ( ! class_exists( 'Redux_Args', false ) ) {
|
|
361 |
if ( is_array( $arr ) && ! empty( $arr ) ) {
|
362 |
foreach ( $arr as $x => $y ) {
|
363 |
if ( strpos( Redux_Core::strtolower( $y ), 'redux' ) !== false ) {
|
364 |
-
$msg = '<strong>' . esc_html__(
|
365 |
-
'Redux Framework
|
366 |
-
'redux-framework'
|
367 |
-
) . '</strong>' . esc_html__(
|
368 |
-
'There are references to the Redux Framework support site in your config\'s',
|
369 |
-
'redux-framework'
|
370 |
-
) . ' <code>share_icons</code> ' . esc_html__(
|
371 |
-
'argument. This is sample data. Please change or remove this data before shipping your product.',
|
372 |
-
'redux-framework'
|
373 |
-
);
|
374 |
|
375 |
$this->omit_icons = true;
|
376 |
}
|
@@ -391,7 +376,7 @@ if ( ! class_exists( 'Redux_Args', false ) ) {
|
|
391 |
private function default_cleanup( array $args ): array {
|
392 |
|
393 |
// Fix the global variable name.
|
394 |
-
if ( '' === $args['global_variable'] && false !==
|
395 |
$args['global_variable'] = str_replace( '-', '_', $args['opt_name'] );
|
396 |
}
|
397 |
|
169 |
$args = $this->args( $args );
|
170 |
$args = $this->default_cleanup( $args );
|
171 |
|
172 |
+
if ( ! in_array( $args['font_display'], array( 'block', 'swap', 'fallback', 'optional' ), true ) ) {
|
173 |
$args['font_display'] = 'swap';
|
174 |
}
|
175 |
+
if ( isset( $args['async_typography'] ) && $args['async_typography'] ) {
|
|
|
176 |
$args['async_typography'] = false;
|
177 |
}
|
178 |
|
249 |
/**
|
250 |
* Sanitize args that should not be empty.
|
251 |
*
|
252 |
+
* @param array $args Global args.
|
253 |
*
|
254 |
* @return array
|
255 |
*/
|
296 |
/**
|
297 |
* Shims for much older v3 configs.
|
298 |
*
|
299 |
+
* @param array $args Global args.
|
300 |
*
|
301 |
* @return array
|
302 |
*/
|
336 |
if ( is_array( $arr ) && ! empty( $arr ) ) {
|
337 |
foreach ( $arr as $x => $y ) {
|
338 |
if ( strpos( Redux_Core::strtolower( $y ), 'redux' ) !== false ) {
|
339 |
+
$msg = '<strong>' . esc_html__( 'Redux Framework Notice', 'redux-framework' ) . ' </strong>' .
|
340 |
+
esc_html__( 'There are references to the Redux Framework support site in your config\'s ', 'redux-framework' ) .
|
341 |
+
'<code>admin_bar_links</code> ' . esc_html__( 'argument. This is sample data. Please change or remove this data before shipping your product.', 'redux-framework' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
|
343 |
$this->omit_items = true;
|
344 |
break;
|
353 |
if ( is_array( $arr ) && ! empty( $arr ) ) {
|
354 |
foreach ( $arr as $x => $y ) {
|
355 |
if ( strpos( Redux_Core::strtolower( $y ), 'redux' ) !== false ) {
|
356 |
+
$msg = '<strong>' . esc_html__( 'Redux Framework Notice:', 'redux-framework' ) . '</strong>' .
|
357 |
+
esc_html__( 'There are references to the Redux Framework support site in your config\'s', 'redux-framework' ) .
|
358 |
+
' <code>share_icons</code> ' . esc_html__( 'argument. This is sample data. Please change or remove this data before shipping your product.', 'redux-framework' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
|
360 |
$this->omit_icons = true;
|
361 |
}
|
376 |
private function default_cleanup( array $args ): array {
|
377 |
|
378 |
// Fix the global variable name.
|
379 |
+
if ( '' === $args['global_variable'] && false !== $args['global_variable'] ) {
|
380 |
$args['global_variable'] = str_replace( '-', '_', $args['opt_name'] );
|
381 |
}
|
382 |
|
redux-core/inc/classes/class-redux-enqueue.php
CHANGED
@@ -218,7 +218,7 @@ if ( ! class_exists( 'Redux_Enqueue', false ) ) {
|
|
218 |
'jquery-ui-css',
|
219 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
220 |
apply_filters(
|
221 |
-
|
222 |
"redux/page/{$core->args['opt_name']}/enqueue/jquery-ui-css",
|
223 |
Redux_Core::$url . 'assets/css/vendor/jquery-ui-1.10.0.custom.css'
|
224 |
),
|
@@ -391,7 +391,7 @@ if ( ! class_exists( 'Redux_Enqueue', false ) ) {
|
|
391 |
|
392 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
393 |
$class_file = apply_filters(
|
394 |
-
|
395 |
"redux/{$core->args['opt_name']}/field/class/{$field['type']}",
|
396 |
$filter_path,
|
397 |
$field
|
@@ -610,7 +610,7 @@ if ( ! class_exists( 'Redux_Enqueue', false ) ) {
|
|
610 |
*/
|
611 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
612 |
$save_pending = apply_filters(
|
613 |
-
|
614 |
"redux/{$core->args['opt_name']}/localize/save_pending",
|
615 |
esc_html__(
|
616 |
'You have changes that are not saved. Would you like to save them now?',
|
@@ -626,7 +626,7 @@ if ( ! class_exists( 'Redux_Enqueue', false ) ) {
|
|
626 |
*/
|
627 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
628 |
$reset_all = apply_filters(
|
629 |
-
|
630 |
"redux/{$core->args['opt_name']}/localize/reset",
|
631 |
esc_html__(
|
632 |
'Are you sure? Resetting will lose all custom values.',
|
@@ -642,7 +642,7 @@ if ( ! class_exists( 'Redux_Enqueue', false ) ) {
|
|
642 |
*/
|
643 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
644 |
$reset_section = apply_filters(
|
645 |
-
|
646 |
"redux/{$core->args['opt_name']}/localize/reset_section",
|
647 |
esc_html__(
|
648 |
'Are you sure? Resetting will lose all custom values in this section.',
|
@@ -658,7 +658,7 @@ if ( ! class_exists( 'Redux_Enqueue', false ) ) {
|
|
658 |
*/
|
659 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
660 |
$preset_confirm = apply_filters(
|
661 |
-
|
662 |
"redux/{$core->args['opt_name']}/localize/preset",
|
663 |
esc_html__(
|
664 |
'Your current options will be replaced with the values of this preset. Would you like to proceed?',
|
@@ -674,7 +674,7 @@ if ( ! class_exists( 'Redux_Enqueue', false ) ) {
|
|
674 |
*/
|
675 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
676 |
$import_confirm = apply_filters(
|
677 |
-
|
678 |
"redux/{$core->args['opt_name']}/localize/import",
|
679 |
esc_html__(
|
680 |
'Your current options will be replaced with the values of this import. Would you like to proceed?',
|
218 |
'jquery-ui-css',
|
219 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
220 |
apply_filters(
|
221 |
+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
222 |
"redux/page/{$core->args['opt_name']}/enqueue/jquery-ui-css",
|
223 |
Redux_Core::$url . 'assets/css/vendor/jquery-ui-1.10.0.custom.css'
|
224 |
),
|
391 |
|
392 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
393 |
$class_file = apply_filters(
|
394 |
+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
395 |
"redux/{$core->args['opt_name']}/field/class/{$field['type']}",
|
396 |
$filter_path,
|
397 |
$field
|
610 |
*/
|
611 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
612 |
$save_pending = apply_filters(
|
613 |
+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
614 |
"redux/{$core->args['opt_name']}/localize/save_pending",
|
615 |
esc_html__(
|
616 |
'You have changes that are not saved. Would you like to save them now?',
|
626 |
*/
|
627 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
628 |
$reset_all = apply_filters(
|
629 |
+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
630 |
"redux/{$core->args['opt_name']}/localize/reset",
|
631 |
esc_html__(
|
632 |
'Are you sure? Resetting will lose all custom values.',
|
642 |
*/
|
643 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
644 |
$reset_section = apply_filters(
|
645 |
+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
646 |
"redux/{$core->args['opt_name']}/localize/reset_section",
|
647 |
esc_html__(
|
648 |
'Are you sure? Resetting will lose all custom values in this section.',
|
658 |
*/
|
659 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
660 |
$preset_confirm = apply_filters(
|
661 |
+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
662 |
"redux/{$core->args['opt_name']}/localize/preset",
|
663 |
esc_html__(
|
664 |
'Your current options will be replaced with the values of this preset. Would you like to proceed?',
|
674 |
*/
|
675 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
676 |
$import_confirm = apply_filters(
|
677 |
+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
678 |
"redux/{$core->args['opt_name']}/localize/import",
|
679 |
esc_html__(
|
680 |
'Your current options will be replaced with the values of this import. Would you like to proceed?',
|
redux-core/inc/classes/class-redux-field.php
CHANGED
@@ -149,9 +149,9 @@ if ( ! class_exists( 'Redux_Field', false ) ) {
|
|
149 |
/**
|
150 |
* Redux_Field constructor.
|
151 |
*
|
152 |
-
* @param array|string $field
|
153 |
-
* @param array|
|
154 |
-
* @param
|
155 |
*
|
156 |
* @throws ReflectionException Comment.
|
157 |
*/
|
@@ -232,9 +232,9 @@ if ( ! class_exists( 'Redux_Field', false ) ) {
|
|
232 |
/**
|
233 |
* CSS for field output, if set.
|
234 |
*
|
235 |
-
* @param string
|
236 |
*/
|
237 |
-
public function output( $style = '' ) {
|
238 |
if ( '' !== $style ) {
|
239 |
|
240 |
// Force output value into an array.
|
@@ -247,7 +247,6 @@ if ( ! class_exists( 'Redux_Field', false ) ) {
|
|
247 |
if ( $this->field['output']['important'] ) {
|
248 |
$style = str_replace( ';', ' !important;', $style );
|
249 |
}
|
250 |
-
|
251 |
unset( $this->field['output']['important'] );
|
252 |
}
|
253 |
|
149 |
/**
|
150 |
* Redux_Field constructor.
|
151 |
*
|
152 |
+
* @param array|string|null $field Field array.
|
153 |
+
* @param string|array|null $value Field values.
|
154 |
+
* @param null $parent ReduxFramework object pointer.
|
155 |
*
|
156 |
* @throws ReflectionException Comment.
|
157 |
*/
|
232 |
/**
|
233 |
* CSS for field output, if set.
|
234 |
*
|
235 |
+
* @param string $style CSS string.
|
236 |
*/
|
237 |
+
public function output( string $style = '' ) {
|
238 |
if ( '' !== $style ) {
|
239 |
|
240 |
// Force output value into an array.
|
247 |
if ( $this->field['output']['important'] ) {
|
248 |
$style = str_replace( ';', ' !important;', $style );
|
249 |
}
|
|
|
250 |
unset( $this->field['output']['important'] );
|
251 |
}
|
252 |
|
redux-core/inc/classes/class-redux-instances.php
CHANGED
@@ -58,7 +58,7 @@ if ( ! class_exists( 'Redux_Instances', false ) ) {
|
|
58 |
*
|
59 |
* @return [type] [description]
|
60 |
*/
|
61 |
-
public static function get_all_instances(): array {
|
62 |
return self::$instances;
|
63 |
}
|
64 |
|
@@ -113,7 +113,7 @@ if ( ! function_exists( 'get_all_redux_instances' ) ) {
|
|
113 |
*
|
114 |
* @return array format ['opt_name' => $ReduxFramework]
|
115 |
*/
|
116 |
-
function get_all_redux_instances(): array {
|
117 |
return Redux_Instances::get_all_instances();
|
118 |
}
|
119 |
}
|
58 |
*
|
59 |
* @return [type] [description]
|
60 |
*/
|
61 |
+
public static function get_all_instances(): ?array {
|
62 |
return self::$instances;
|
63 |
}
|
64 |
|
113 |
*
|
114 |
* @return array format ['opt_name' => $ReduxFramework]
|
115 |
*/
|
116 |
+
function get_all_redux_instances(): ?array {
|
117 |
return Redux_Instances::get_all_instances();
|
118 |
}
|
119 |
}
|
redux-framework.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* Description: Build better sites in WordPress fast
|
11 |
* Author: Redux.io
|
12 |
* Author URI: http://redux.io
|
13 |
-
* Version: 4.2.
|
14 |
* Text Domain: redux-framework
|
15 |
* License: GPLv3 or later
|
16 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
10 |
* Description: Build better sites in WordPress fast
|
11 |
* Author: Redux.io
|
12 |
* Author URI: http://redux.io
|
13 |
+
* Version: 4.2.8
|
14 |
* Text Domain: redux-framework
|
15 |
* License: GPLv3 or later
|
16 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|