Closed brasofilo closed 1 year ago
The reason the class doesn't load is that the network admin panel feature was never finished. We couldn't make it work properly. The code was left in with the idea it may be revisited. It never happened. You're free to keep trying, but it's unlikely we'll finish that feature. The demand isn't there to justify the time.
Ok, gotcha, thanks for the feedback!
Site Health Report
Steps to reproduce
I tested with a vanilla plugin just loading Redux config file. The plugin is Network Enabled on an empty WP installation in my computer.
The
init
method loads the config and that's about it:add_action( 'plugins_loaded', [__CLASS__, 'init'] );
I'm using the
barebone-config.php
and these are the relevant arguments:I'm not using AJAX to save, and when we save our options the plugin redirects to WordPress Dashboard:
/wp-admin/network/index.php
. Navigating back to the plugin page (/wp-admin/network/admin.php?page=my_options
) shows that the options were not saved.If I change
ajax_save
to true, the options are saved correctly.Expected Behavior
The plugin should save the options and go back to the plugin page:
admin.php?page=my_options
Actual Behavior
The hook that saves multisite options is
network_admin_edit_{$_GET['action']}
.I found it inside the file
/redux-core/inc/classes/class-redux-network.php
that defines theRedux_Network
class. The class is not used anywhere inside redux-core.I instantiated the network class inside
redux-core/framework.php
constructor and the Save action started working (see error below *``**).Any Error Details (PHP/JavaScript)
*``** It works but there is the following error:
PHP Fatal error: Uncaught TypeError: Redux_Options_Constructor::validate_options(): Argument #1 ($plugin_options) must be of type array, string given, called in /redux-multisite/redux-core/inc/classes/class-redux-network.php on line 75 and defined in /redux-multisite/redux-core/inc/classes/class-redux-options-constructor.php:710
The error is being caused by the function sanitize_text_field in line 69 of
class-redux-network.php
.If we remove it, the Multisite Save Options without AJAX finally works ok; I'm not sure how to fix this one though...