• hi,
    I need to change all the blogs in my network to
    “Visible only to registered users of this site”
    except one whine needs to be:
    “Visible only to registered users of this network”

    any ideas?

    thanks,
    dori

Viewing 1 replies (of 1 total)
  • I offer what I would do:

    Write a function in a php file in your mu-plugins that hooks the wpmu_upgrade_site action (fires when you upgrade network then walks through each blog one by one at /wp-admin/network/upgrade.php) to update_blog_option.

    Here’s an example that’ll switch all blogs to “Visible only to registered users of this site”(-2)

    <?php
    function my_wordpress_option_reset( $blog_id ) {
    update_blog_option( $blog_id, 'blog_public','-2');
    }
    add_action( 'wpmu_upgrade_site', 'my_wordpress_option_reset' );
    ?>

    Then just stop by the one blog that is is exception and set the visibility setting there as you normally do.

    I offer this if you also want those options locked in so those site admins can’t change the settings back again. If you are handy with writing plugin snippets, you could use the plugin to set a “pre_option” on all blogs via an mu-plugin as well.

Viewing 1 replies (of 1 total)
  • The topic ‘changing Site Visibility to all my mu blogs’ is closed to new replies.