Last active
February 10, 2016 13:57
-
-
Save sjaved87/18dde5eb3a23faafeb05 to your computer and use it in GitHub Desktop.
disable a network enabled plugin for just one or more subsite(s)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
This simple snippet willy disable plugin per site basis. | |
Replace 2,3,4 with acutal website ID(s) for those you want to disable this plugin | |
This snippet can also be used to disable any network activated plugin. Only thing you have to do is copy the folder and file name of plugin e.g akismet/akismet.php | |
*/ | |
add_filter('site_option_active_sitewide_plugins', 'wpmu_modify_sitewide_plugins'); | |
function wpmu_modify_sitewide_plugins($value) { | |
global $current_blog; | |
if( in_array( $current_blog->blog_id, array(2,3,4) ) ) { | |
unset($value['easyblogging/easyblogging.php']); | |
} | |
return $value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks sorich87 from http://wordpress.stackexchange.com/users/473/sorich87
I modified it a bit for multiple sites:
http://wordpress.stackexchange.com/questions/3426/how-to-disable-a-network-enabled-plugin-for-just-one-site