Skip to content

Commit b42e1e3

Browse files
committed
#3681 - Incorrect global variable assignment. Thanks @webbudesign
Signed-off-by: Kev Provance <[email protected]>
1 parent 726395e commit b42e1e3

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ public static function create_redux() {
404404
foreach ( self::$sections as $opt_name => $the_sections ) {
405405
if ( ! empty( $the_sections ) ) {
406406
if ( ! self::$init[ $opt_name ] ) {
407-
self::loadRedux( $opt_name );
407+
self::load_redux( $opt_name );
408408
}
409409
}
410410
}
@@ -905,7 +905,6 @@ public static function set_field( string $opt_name = '', $section_id = '', array
905905
// Shim for the old method!
906906
if ( is_array( $section_id ) ) {
907907
$field = $section_id;
908-
909908
if ( isset( $field['section_id'] ) ) {
910909
$section_id = $field['section_id'];
911910
}
@@ -1123,7 +1122,7 @@ public static function set_developer( string $opt_name = '', $arg = '' ) {
11231122
}
11241123

11251124
/**
1126-
* Deprecated Retrieves option panel global argument array.
1125+
* Deprecated Retries option panel global argument array.
11271126
*
11281127
* @param string $opt_name Panel opt_name.
11291128
*
@@ -1135,7 +1134,7 @@ public static function getArgs( string $opt_name = '' ) { // phpcs:ignore WordPr
11351134
}
11361135

11371136
/**
1138-
* Retrieves option panel global argument array.
1137+
* Retries option panel global argument array.
11391138
*
11401139
* @param string $opt_name Panel opt_name.
11411140
* @param string $key Argument key name to be returned.
@@ -1224,6 +1223,8 @@ public static function get_post_meta( string $opt_name = '', $the_post = array()
12241223

12251224
$redux = ReduxFrameworkInstances::get_instance( $opt_name );
12261225

1226+
// We don't ever need to specify advanced_metaboxes here as all function for metaboxes are core,
1227+
// and thus, metabox_lite. The extension handles its own functions and is handled by this condition. - kp.
12271228
$metaboxes = $redux->extensions['metaboxes'];
12281229

12291230
if ( null === $default || '' === $default ) {
@@ -1690,8 +1691,7 @@ public static function get_extensions( string $opt_name = '', string $key = '' )
16901691

16911692
/**
16921693
* Method to disables Redux demo mode popup.
1693-
*
1694-
* @noinspection PhpUnused*/
1694+
*/
16951695
public static function disable_demo() {
16961696
add_action( 'ReduxFrameworkPlugin_admin_notice', 'Redux::remove_demo' );
16971697
add_action( 'redux_framework_plugin_admin_notice', 'Redux::remove_demo' );
@@ -1707,7 +1707,7 @@ public static function remove_demo() {
17071707
/**
17081708
* Function which forces a panel/page to render.
17091709
*
1710-
* @param string/ReduxFramework $redux Panel opt_name or Redux object.
1710+
* @param string|object $redux Panel opt_name or Redux object.
17111711
*/
17121712
public static function render( $redux = '' ) {
17131713
if ( is_string( $redux ) ) {
@@ -1716,7 +1716,6 @@ public static function render( $redux = '' ) {
17161716
return;
17171717
}
17181718
}
1719-
17201719
$enqueue = new Redux_Enqueue( $redux );
17211720
$enqueue->init();
17221721
$panel = new Redux_Panel( $redux );

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ private function change_demo_defaults( array $args ) {
380380
private function default_cleanup( array $args ): array {
381381

382382
// Fix the global variable name.
383-
if ( '' === $args['global_variable'] || false !== $args['global_variable'] ) {
383+
if ( '' === $args['global_variable'] && false !== $args['global_variable'] ) {
384384
$args['global_variable'] = str_replace( '-', '_', $args['opt_name'] );
385385
}
386386

redux-core/inc/classes/class-redux-options-constructor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ public function register() {
548548
// phpcs:ignore WordPress.NamingConventions.ValidHookName
549549
$field = apply_filters( "redux/options/{$core->args['opt_name']}/field/{$field['id']}", $field );
550550

551-
if ( empty( $field ) ) {
551+
if ( empty( $field ) || ! $field ) {
552552
unset( $core->sections[ $k ]['fields'][ $fieldk ] );
553553
continue;
554554
}
@@ -675,9 +675,9 @@ public function register() {
675675
*
676676
* @since 1.0.0
677677
* @access public
678-
* @return array|null|string $this->options_defaults
678+
* @return array $this->options_defaults
679679
*/
680-
public function default_values() {
680+
public function default_values(): array {
681681
$core = $this->core();
682682

683683
if ( ! is_null( $core->sections ) && is_null( $core->options_defaults ) ) {

0 commit comments

Comments
 (0)