Skip to content

Commit 4747cbc

Browse files
committed
Saved changes now show on the front.
Signed-off-by: Kevin Provance <[email protected]>
1 parent f593f8f commit 4747cbc

10 files changed

+42
-52
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Redux Changelog
22

3+
## 4.2.8
4+
* Fixed Redux instances returning null. Saved options now show on the front end.
5+
36
## 4.2.7
47
* Fixed: Options reverting or not saving.
58

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"main": "gulpfile.js",
44
"name": "redux",
55
"author": "Redux.io",
6-
"version": "4.2.7",
6+
"version": "4.2.8",
77
"license": "GPL-3.0-or-later",
88
"repository": {
99
"type": "git",

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: gutenberg, blocks, gutenberg blocks, editor, block, page builder, block ed
44
Requires at least: 4.0
55
Requires PHP: 7.1
66
Tested up to: 5.8
7-
Stable tag: 4.2.7
7+
Stable tag: 4.2.8
88
License: GPL-3.0+
99
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
1010

@@ -152,6 +152,9 @@ If you want, you can use the [Gutenberg](https://wordpress.org/plugins/gutenberg
152152

153153
== Changelog ==
154154

155+
= 4.2.8 =
156+
Redux instances returning null. Saved options now show on the front end.
157+
155158
= 4.2.7 =
156159
Fixed: Options reverting or not saving.
157160

redux-core/framework.php

Lines changed: 1 addition & 1 deletion
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.2.7';
26+
Redux_Core::$version = '4.2.8';
2727
Redux_Core::$redux_path = dirname( __FILE__ );
2828
Redux_Core::instance();
2929

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ public static function instance( string $opt_name ) {
197197
/**
198198
* Retrieve all ReduxFramework Instances.
199199
*
200-
* @return array|ReduxFramework[]
200+
* @return null|array|ReduxFramework[]
201201
*/
202-
public static function all_instances(): array {
202+
public static function all_instances(): ?array {
203203
return Redux_Instances::get_all_instances();
204204
}
205205

@@ -926,9 +926,9 @@ public static function set_field( string $opt_name = '', $section_id = '', array
926926
/**
927927
* Create multiple fields of the option panel and apply to a section.
928928
*
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.
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.
932932
*/
933933
public static function set_fields( string $opt_name = '', $section_id = '', array $fields = array() ) {
934934
if ( ! is_array( $fields ) || empty( $fields ) || '' === $opt_name || '' === $section_id ) {
@@ -1581,7 +1581,7 @@ private static function get_all_extension() {
15811581
/**
15821582
* Gets all loaded extension for the passed ReduxFramework instance.
15831583
*
1584-
* @param string $opt_name Panel opt_name.
1584+
* @param string $opt_name Panel opt_name.
15851585
* @param object|null $instance ReduxFramework instance.
15861586
*/
15871587
public static function get_instance_extension( string $opt_name, $instance ) {

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

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,10 @@ public function __construct( $parent, array $args ) {
169169
$args = $this->args( $args );
170170
$args = $this->default_cleanup( $args );
171171

172-
if ( ! in_array( $args['font_display'], array( 'auto', 'block', 'swap', 'fallback', 'optional' ), true ) ) {
172+
if ( ! in_array( $args['font_display'], array( 'block', 'swap', 'fallback', 'optional' ), true ) ) {
173173
$args['font_display'] = 'swap';
174174
}
175-
176-
if ( isset($args['async_typography']) && $args['async_typography'] ) {
175+
if ( isset( $args['async_typography'] ) && $args['async_typography'] ) {
177176
$args['async_typography'] = false;
178177
}
179178

@@ -250,7 +249,7 @@ private function filters( array $args ) {
250249
/**
251250
* Sanitize args that should not be empty.
252251
*
253-
* @param array $args Global args.
252+
* @param array $args Global args.
254253
*
255254
* @return array
256255
*/
@@ -297,7 +296,7 @@ private function no_errors_please( array $args ): array {
297296
/**
298297
* Shims for much older v3 configs.
299298
*
300-
* @param array $args Global args.
299+
* @param array $args Global args.
301300
*
302301
* @return array
303302
*/
@@ -337,16 +336,9 @@ private function change_demo_defaults( array $args ) {
337336
if ( is_array( $arr ) && ! empty( $arr ) ) {
338337
foreach ( $arr as $x => $y ) {
339338
if ( strpos( Redux_Core::strtolower( $y ), 'redux' ) !== false ) {
340-
$msg = '<strong>' . esc_html__(
341-
'Redux Framework Notice',
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-
);
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' );
350342

351343
$this->omit_items = true;
352344
break;
@@ -361,16 +353,9 @@ private function change_demo_defaults( array $args ) {
361353
if ( is_array( $arr ) && ! empty( $arr ) ) {
362354
foreach ( $arr as $x => $y ) {
363355
if ( strpos( Redux_Core::strtolower( $y ), 'redux' ) !== false ) {
364-
$msg = '<strong>' . esc_html__(
365-
'Redux Framework Notice:',
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-
);
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' );
374359

375360
$this->omit_icons = true;
376361
}
@@ -391,7 +376,7 @@ private function change_demo_defaults( array $args ) {
391376
private function default_cleanup( array $args ): array {
392377

393378
// Fix the global variable name.
394-
if ( '' === $args['global_variable'] && false !== (bool) $args['global_variable'] ) {
379+
if ( '' === $args['global_variable'] && false !== $args['global_variable'] ) {
395380
$args['global_variable'] = str_replace( '-', '_', $args['opt_name'] );
396381
}
397382

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private function register_styles( $core ) {
218218
'jquery-ui-css',
219219
// phpcs:ignore WordPress.NamingConventions.ValidHookName
220220
apply_filters(
221-
// phpcs:ignore WordPress.NamingConventions.ValidHookName
221+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
222222
"redux/page/{$core->args['opt_name']}/enqueue/jquery-ui-css",
223223
Redux_Core::$url . 'assets/css/vendor/jquery-ui-1.10.0.custom.css'
224224
),
@@ -391,7 +391,7 @@ public function enqueue_field( $core, array $field ) {
391391

392392
// phpcs:ignore WordPress.NamingConventions.ValidHookName
393393
$class_file = apply_filters(
394-
// phpcs:ignore WordPress.NamingConventions.ValidHookName
394+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
395395
"redux/{$core->args['opt_name']}/field/class/{$field['type']}",
396396
$filter_path,
397397
$field
@@ -610,7 +610,7 @@ private function set_localized_data( $core ) {
610610
*/
611611
// phpcs:ignore WordPress.NamingConventions.ValidHookName
612612
$save_pending = apply_filters(
613-
// phpcs:ignore WordPress.NamingConventions.ValidHookName
613+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
614614
"redux/{$core->args['opt_name']}/localize/save_pending",
615615
esc_html__(
616616
'You have changes that are not saved. Would you like to save them now?',
@@ -626,7 +626,7 @@ private function set_localized_data( $core ) {
626626
*/
627627
// phpcs:ignore WordPress.NamingConventions.ValidHookName
628628
$reset_all = apply_filters(
629-
// phpcs:ignore WordPress.NamingConventions.ValidHookName
629+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
630630
"redux/{$core->args['opt_name']}/localize/reset",
631631
esc_html__(
632632
'Are you sure? Resetting will lose all custom values.',
@@ -642,7 +642,7 @@ private function set_localized_data( $core ) {
642642
*/
643643
// phpcs:ignore WordPress.NamingConventions.ValidHookName
644644
$reset_section = apply_filters(
645-
// phpcs:ignore WordPress.NamingConventions.ValidHookName
645+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
646646
"redux/{$core->args['opt_name']}/localize/reset_section",
647647
esc_html__(
648648
'Are you sure? Resetting will lose all custom values in this section.',
@@ -658,7 +658,7 @@ private function set_localized_data( $core ) {
658658
*/
659659
// phpcs:ignore WordPress.NamingConventions.ValidHookName
660660
$preset_confirm = apply_filters(
661-
// phpcs:ignore WordPress.NamingConventions.ValidHookName
661+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
662662
"redux/{$core->args['opt_name']}/localize/preset",
663663
esc_html__(
664664
'Your current options will be replaced with the values of this preset. Would you like to proceed?',
@@ -674,7 +674,7 @@ private function set_localized_data( $core ) {
674674
*/
675675
// phpcs:ignore WordPress.NamingConventions.ValidHookName
676676
$import_confirm = apply_filters(
677-
// phpcs:ignore WordPress.NamingConventions.ValidHookName
677+
// phpcs:ignore WordPress.NamingConventions.ValidHookName
678678
"redux/{$core->args['opt_name']}/localize/import",
679679
esc_html__(
680680
'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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ public static function make_descriptor() {
149149
/**
150150
* Redux_Field constructor.
151151
*
152-
* @param array|string $field Field array.
153-
* @param array|string $value Field values.
154-
* @param object $parent ReduxFramework object pointer.
152+
* @param array $field Field array.
153+
* @param string|array|null $value Field values.
154+
* @param null $parent ReduxFramework object pointer.
155155
*
156156
* @throws ReflectionException Comment.
157157
*/
158-
public function __construct( $field = array(), $value = null, $parent = null ) {
158+
public function __construct( array $field = array(), $value = null, $parent = null ) {
159159
$this->parent = $parent;
160160
$this->field = $field;
161161
$this->value = $value;
@@ -232,9 +232,9 @@ public function media_query( string $style_data = '' ) {
232232
/**
233233
* CSS for field output, if set.
234234
*
235-
* @param string|array|null $style CSS string.
235+
* @param string $style CSS string.
236236
*/
237-
public function output( $style = '' ) {
237+
public function output( string $style = '' ) {
238238
if ( '' !== $style ) {
239239

240240
// Force output value into an array.
@@ -247,7 +247,6 @@ public function output( $style = '' ) {
247247
if ( $this->field['output']['important'] ) {
248248
$style = str_replace( ';', ' !important;', $style );
249249
}
250-
251250
unset( $this->field['output']['important'] );
252251
}
253252

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function get_redux_instance( $opt_name = '' ) {
5858
*
5959
* @return [type] [description]
6060
*/
61-
public static function get_all_instances(): array {
61+
public static function get_all_instances(): ?array {
6262
return self::$instances;
6363
}
6464

@@ -113,7 +113,7 @@ function get_redux_instance( $opt_name ) {
113113
*
114114
* @return array format ['opt_name' => $ReduxFramework]
115115
*/
116-
function get_all_redux_instances(): array {
116+
function get_all_redux_instances(): ?array {
117117
return Redux_Instances::get_all_instances();
118118
}
119119
}

redux-framework.php

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

0 commit comments

Comments
 (0)