Support » Plugins and Hacks » Hacks » How can I use site_option filter to unset a network activated plugin?

  • 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

Viewing 1 replies (of 1 total)
  • 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.

Viewing 1 replies (of 1 total)
  • The topic ‘How can I use site_option filter to unset a network activated plugin?’ is closed to new replies.