multisite shared settings

Update from comments

To convert an array of options to site options, you can try something like this:

add_action( 'init', 'wpse245699_use_site_options' );
function wpse245699_use_site_options() {
    // Uses site options for these options.
    $required_site_options = array(
        'some_option_name',
        'another_option_name',
        'and_another_one',
    );
    foreach( $required_site_options as $option ) {
        add_action( 'update_option_' . $option, 'wpse245699_update_site_option', 10, 3 );
        add_filter( 'pre_option_' . $option, 'wpse245699_get_site_option', 10, 2 );
    }
}

function wpse245699_update_site_option( $old_value, $value, $option ) {
    update_site_option( $option, $value );
}

function wpse245699_get_site_option( $pre_option = false, $option ) {
    return get_site_option( $option );
}

This code is untested.

I wouldn’t recommend converting all of WordPress’s options to site options; there are a number of core options in use on every site, and setting them all to identical values would most likely end badly.


WordPress Multisite uses one table for all its users already; you shouldn’t need any kind of “config hack” to accomplish this. As for plugins and settings: you can Network Activate plugins and they’ll run on every site in your Multisite network. And settings (or options — I assume you’re referring to the data stored by the Options API) can be stored and retrieved on a per-site basis (using the *_option() functions) or globally across the network (using the *_site_option() functions).

WordPress stores virtually all its data in the database, so saving and loading options/settings from a file isn’t really The WordPress Way.

References