Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Suggested/optional code for multisite and SuperSide Me, if the preference is to use the same settings on all sites in the network.
<?php
// Disable the SuperSide Me settings page and customizer panel on child sites
if ( ! is_main_site() ) {
add_filter( 'supersideme_disable_customizer_panel', '__return_true' );
add_filter( 'supersideme_disable_settings_page', '__return_true' );
}
add_filter( 'supersideme_get_plugin_setting', 'prefix_supersideme_use_main_site_setting', 20 );
/**
* In a multisite setup, use the main site settings for all child sites.
*
* @param $setting
*
* @return array
*/
function prefix_supersideme_use_main_site_setting( $setting ) {
if ( is_main_site() ) {
return $setting;
}
$main_site = get_network()->site_id;
return wp_parse_args( get_blog_option( $main_site, 'supersideme' ), $setting );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.