Skip to content

Instantly share code, notes, and snippets.

@sjaved87
Last active February 10, 2016 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjaved87/18dde5eb3a23faafeb05 to your computer and use it in GitHub Desktop.
Save sjaved87/18dde5eb3a23faafeb05 to your computer and use it in GitHub Desktop.
disable a network enabled plugin for just one or more subsite(s)
<?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;
}
@sjaved87
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment