Created
June 4, 2012 23:05
-
-
Save tylerdigital/2871384 to your computer and use it in GitHub Desktop.
Automatically activate Inform About Content plugin only on P2 blogs (WordPress multisite)
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
add_filter('option_active_plugins', 'p2_filter_active_plugins'); | |
function p2_filter_active_plugins($active_plugins) { | |
if(get_template()!='p2') return $active_plugins; | |
$required_plugins = array( | |
'inform-about-content/inform-about-content.php' | |
); | |
foreach ($required_plugins as $key => $plugin) { | |
if(!(in_array($plugin, $active_plugins))) $active_plugins[] = $plugin; | |
} | |
return $active_plugins; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment