WordPress.org

Forums

How can I use site_option filter to unset a network activated plugin? (2 posts)

  1. Norbert McDorbert
    Member
    Posted 2 years ago #

    I would like to unset plugins for the network for my main site. I have found this code.

    add_filter('site_option_active_sitewide_plugins', 'modify_sitewide_plugins');
    
    function modify_sitewide_plugins($value) {
        global $current_blog;
    
        if( $current_blog->blog_id == 2 ) {
            unset($value['akismet/akismet.php']);
        }
    
        return $value;
    }

    But where does this go?

    I am using 3.4*; Multiste, etc

    wish to unset a few plugins from blog_id==1

  2. Micah Wood
    Member
    Posted 2 years ago #

    Norbert,

    Because plugins get loaded pretty early, you would probably be best off to create a plugin in the mu-plugins directory and drop your code in there.

Topic Closed

This topic has been closed to new replies.

About this Topic