• Resolved janiu

    (@janiu)


    We have a multisite setup with hundreds of blogs. Is there a way to define settings for the whole network? Or have the network blogs follow settings from the main blog? And also to restrict settings for Super Admins and hide them from blog admins.

Viewing 1 replies (of 1 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    Yes, the second suggestion of yours is easily implemented.

    First, I recommend defining this in wp-config or a mu-plugin:

    define( 'THE_SEO_FRAMEWORK_SETTINGS_CAP', 'manage_network' );
    

    Then, you’d want to filter the_seo_framework_default_site_options and merge get_blog_option( 1, THE_SEO_FRAMEWORK_SITE_OPTIONS ) with it:

    add_filter( 'the_seo_framework_default_site_options', function( $defaults ) {
    	return array_merge( 
    		$defaults, 
    		get_blog_option( 1, THE_SEO_FRAMEWORK_SITE_OPTIONS ) ?: []
    	);
    } );

    This way, the primary site’s options are written to all subsites’ defaults. If a subsite installed The SEO Framework before you implemented the filter, you could merge the settings by hitting “Reset Settings” on the SEO Settings page on the subsite.

    • This reply was modified 3 years, 2 months ago by Sybre Waaijer. Reason: proper code formatting
Viewing 1 replies (of 1 total)

The topic ‘Multisite settings’ is closed to new replies.