Skip to content

Commit

Permalink
Revert changed made to specific objects to generic objects. My guess …
Browse files Browse the repository at this point in the history
…as to when options are not saving for some.

Signed-off-by: Kevin Provance <kevin.provance@gmail.com>
  • Loading branch information
kprovance committed Jul 28, 2021
1 parent 1fd0bcf commit 99bee52
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 55 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Redux Changelog

## 4.2.7
* Fixed: Options reverting or not saving.

## 4.2.6
* Fixed: Fatal error if passing null as an option section.
* Fixed: Error in connection banner routine.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"main": "gulpfile.js",
"name": "redux",
"author": "Redux.io",
"version": "4.2.6",
"version": "4.2.7",
"license": "GPL-3.0-or-later",
"repository": {
"type": "git",
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: gutenberg, blocks, gutenberg blocks, editor, block, page builder, block ed
Requires at least: 4.0
Requires PHP: 7.1
Tested up to: 5.8
Stable tag: 4.2.6
Stable tag: 4.2.7
License: GPL-3.0+
License URI: http://www.gnu.org/licenses/gpl-3.0.txt

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

== Changelog ==

= 4.2.7 =
Fixed: Options reverting or not saving.

= 4.2.6 =
Fixed: Fatal error if passing null as an option section.
Fixed: Error in connection banner routine.
Expand Down
6 changes: 3 additions & 3 deletions redux-core/class-redux-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@ private function init() {
/**
* Code to execute on framework __construct.
*
* @param ReduxFramework $parent Pointer to ReduxFramework object.
* @param array $args Global arguments array.
* @param object $parent Pointer to ReduxFramework object.
* @param array $args Global arguments array.
*/
public static function core_construct( ReduxFramework $parent, array $args ) {
public static function core_construct( $parent, array $args ) {
self::$third_party_fixes = new Redux_ThirdParty_Fixes( $parent );

Redux_ThemeCheck::get_instance();
Expand Down
2 changes: 1 addition & 1 deletion redux-core/framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

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

Redux_Core::$version = '4.2.6';
Redux_Core::$version = '4.2.7';
Redux_Core::$redux_path = dirname( __FILE__ );
Redux_Core::instance();

Expand Down
10 changes: 4 additions & 6 deletions redux-core/inc/classes/class-redux-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,7 @@ public static function set_sections( string $opt_name = '', array $sections = ar
Redux_Functions_Ex::record_caller( $opt_name );

foreach ( $sections as $section ) {
if ( isset( $section ) && ! empty( $section ) ) {
self::set_section( $opt_name, $section );
}
self::set_section( $opt_name, $section );
}
}

Expand Down Expand Up @@ -1584,9 +1582,9 @@ private static function get_all_extension() {
* Gets all loaded extension for the passed ReduxFramework instance.
*
* @param string $opt_name Panel opt_name.
* @param ReduxFramework|null $instance ReduxFramework instance.
* @param object|null $instance ReduxFramework instance.
*/
public static function get_instance_extension( string $opt_name, ?ReduxFramework $instance ) {
public static function get_instance_extension( string $opt_name, $instance ) {
if ( ! empty( self::$uses_extensions[ $opt_name ] ) || empty( $opt_name ) ) {
return;
}
Expand Down Expand Up @@ -1712,7 +1710,7 @@ public static function remove_demo() {
/**
* Function which forces a panel/page to render.
*
* @param string|ReduxFramework $redux Panel opt_name or Redux object.
* @param string|object $redux Panel opt_name or Redux object.
*/
public static function render( $redux = '' ) {
if ( is_string( $redux ) ) {
Expand Down
4 changes: 2 additions & 2 deletions redux-core/inc/classes/class-redux-class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ class Redux_Class {
/**
* Redux_Class constructor.
*
* @param null|ReduxFramework $parent Pointer to ReduxFramework object.
* @param null|object $parent Pointer to ReduxFramework object.
*/
public function __construct( ?ReduxFramework $parent = null ) {
public function __construct( $parent = null ) {
if ( null !== $parent && is_object( $parent ) ) {
$this->parent = $parent;
$this->args = $parent->args;
Expand Down
12 changes: 6 additions & 6 deletions redux-core/inc/classes/class-redux-enqueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,10 @@ private function register_scripts( $core ) {
/**
* Enqueue fields that are in use.
*
* @param ReduxFramework $core ReduxFramework object.
* @param array $field Field array.
* @param object $core ReduxFramework object.
* @param array $field Field array.
*/
public function enqueue_field( ReduxFramework $core, array $field ) {
public function enqueue_field( $core, array $field ) {
if ( isset( $field['type'] ) && 'callback' !== $field['type'] ) {

/**
Expand Down Expand Up @@ -500,10 +500,10 @@ private function enqueue_fields( $core ) {
/**
* Build localize array from field functions, if any.
*
* @param ReduxFramework $core ReduxFramework object.
* @param string $type Field type.
* @param object $core ReduxFramework object.
* @param string $type Field type.
*/
private function build_local_array( ReduxFramework $core, string $type ) {
private function build_local_array( $core, string $type ) {
if ( isset( $core->transients['last_save_mode'] ) && ! empty( $core->transients['notices'][ $type ] ) ) {
$the_total = 0;
$messages = array();
Expand Down
6 changes: 3 additions & 3 deletions redux-core/inc/classes/class-redux-extension-abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ abstract class Redux_Extension_Abstract {
/**
* Redux_Extension_Abstract constructor.
*
* @param ReduxFramework $parent ReduxFramework pointer.
* @param string $file Extension file.
* @param object $parent ReduxFramework pointer.
* @param string $file Extension file.
*/
public function __construct( ReduxFramework $parent, string $file = '' ) {
public function __construct( $parent, string $file = '' ) {
$this->parent = $parent;

// If the file is not given make sure we have one.
Expand Down
8 changes: 4 additions & 4 deletions redux-core/inc/classes/class-redux-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ public static function make_descriptor() {
/**
* Redux_Field constructor.
*
* @param array|string $field Field array.
* @param array|string $value Field values.
* @param ReduxFramework $parent ReduxFramework object pointer.
* @param array|string $field Field array.
* @param array|string $value Field values.
* @param object $parent ReduxFramework object pointer.
*
* @throws ReflectionException Comment.
*/
public function __construct( $field = array(), $value = null, ReduxFramework $parent = null ) {
public function __construct( $field = array(), $value = null, $parent = null ) {
$this->parent = $parent;
$this->field = $field;
$this->value = $value;
Expand Down
12 changes: 6 additions & 6 deletions redux-core/inc/classes/class-redux-functions-ex.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,15 @@ public static function is_inside_theme( string $file = '' ) {
/**
* Used to fix 3.x and 4 compatibility for extensions
*
* @param ReduxFramework $parent The extension parent object.
* @param string $path - Path of the file.
* @param string $ext_class - Extension class name.
* @param string $new_class_name - New dynamic class name.
* @param string $name extension name.
* @param object $parent The extension parent object.
* @param string $path - Path of the file.
* @param string $ext_class - Extension class name.
* @param string $new_class_name - New dynamic class name.
* @param string $name extension name.
*
* @return object - Extended field class.
*/
public static function extension_compatibility( ReduxFramework $parent, string $path, string $ext_class, string $new_class_name, string $name ) {
public static function extension_compatibility( $parent, string $path, string $ext_class, string $new_class_name, string $name ) {
if ( empty( $new_class_name ) ) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions redux-core/inc/classes/class-redux-helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ public static function is_field_in_use_by_type( array $fields, array $field = ar
/**
* Deprecated Verifies if field is in use.
*
* @param ReduxFramework $parent ReduxFramework object.
* @param string $field Field type.
* @param object $parent ReduxFramework object.
* @param string $field Field type.
*
* @return bool
* @deprecated No longer using camelCase function names.
*/
public static function isFieldInUse( ReduxFramework $parent, string $field ): bool { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName
public static function isFieldInUse( $parent, string $field ): bool { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName
// phpcs:ignore Squiz.PHP.CommentedOutCode
// _deprecated_function( __CLASS__ . '::' . __FUNCTION__, 'Redux 4.0', 'Redux_Helpers::is_field_in_use( $parent, $field )' );
return self::is_field_in_use( $parent, $field );
Expand Down
6 changes: 3 additions & 3 deletions redux-core/inc/classes/class-redux-i18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class Redux_I18n extends Redux_Class {
/**
* Redux_I18n constructor.
*
* @param ReduxFramework $parent ReduxFramework pointer.
* @param string $file Translation file.
* @param object $parent ReduxFramework pointer.
* @param string $file Translation file.
*/
public function __construct( ReduxFramework $parent, string $file ) {
public function __construct( $parent, string $file ) {
parent::__construct( $parent );

$this->load( $file );
Expand Down
12 changes: 6 additions & 6 deletions redux-core/inc/classes/class-redux-output.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,17 @@ public function add_style_attributes( string $html = '', string $handle = '', st
/**
* Function to output output_variables to the dynamic output.
*
* @param ReduxFramework $core ReduxFramework core pointer.
* @param array $section Section containing this field.
* @param array $field Field object.
* @param array|string $value Current value of field.
* @param string|null $style_data CSS output string to append to the root output variable.
* @param object $core ReduxFramework core pointer.
* @param array $section Section containing this field.
* @param array $field Field object.
* @param array|string $value Current value of field.
* @param string|null $style_data CSS output string to append to the root output variable.
*
* @return void
* @since 4.0.3
* @access public
*/
private function output_variables( ReduxFramework $core, array $section = array(), array $field = array(), $value = array(), ?string $style_data = '' ) {
private function output_variables( $core, array $section = array(), array $field = array(), $value = array(), ?string $style_data = '' ) {
// Let's allow section overrides please.
if ( isset( $section['output_variables'] ) && ! isset( $field['output_variables'] ) ) {
$field['output_variables'] = $section['output_variables'];
Expand Down
8 changes: 4 additions & 4 deletions redux-core/inc/classes/class-redux-required.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ public function check_dependencies( array $field ) {
/**
* Check field for require deps.
*
* @param ReduxFramework $core ReduxFramework core pointer.
* @param array $field Field array.
* @param array $data Required data.
* @param object $core ReduxFramework core pointer.
* @param array $field Field array.
* @param array $data Required data.
*/
private function check_required_dependencies( ReduxFramework $core, array $field, array $data ) {
private function check_required_dependencies( $core, array $field, array $data ) {
// required field must not be hidden. Otherwise, hide this one by default.
if ( ! in_array( $data['parent'], $core->fields_hidden, true ) && ( ! isset( $core->folds[ $field['id'] ] ) || 'hide' !== $core->folds[ $field['id'] ] ) ) {
if ( isset( $core->options[ $data['parent'] ] ) ) {
Expand Down
10 changes: 5 additions & 5 deletions redux-core/inc/classes/class-redux-validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ abstract class Redux_Validate {
/**
* Redux_Validate constructor.
*
* @param ReduxFramework $parent ReduxFramework pointer.
* @param array $field Fields array.
* @param array|string $value Values array.
* @param mixed $current Current.
* @param object $parent ReduxFramework pointer.
* @param array $field Fields array.
* @param array|string $value Values array.
* @param mixed $current Current.
*/
public function __construct( ReduxFramework $parent, array $field, $value, $current ) {
public function __construct( $parent, array $field, $value, $current ) {
$this->parent = $parent;
$this->field = $field;
$this->value = $value;
Expand Down
2 changes: 1 addition & 1 deletion redux-framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Description: Build better sites in WordPress fast
* Author: Redux.io
* Author URI: http://redux.io
* Version: 4.2.6
* Version: 4.2.7
* Text Domain: redux-framework
* License: GPLv3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
Expand Down

0 comments on commit 99bee52

Please sign in to comment.