-
-
Save johnie/84b278c7908a42e26255 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Force enable a plugin. | |
* | |
* @param array $plugins | |
* | |
* @return array | |
*/ | |
add_filter( 'option_active_plugins', function ( $plugins ) { | |
return array_merge( $plugins, [ | |
'akismet/akismet.php' | |
] ); | |
} ); | |
/** | |
* Force network enable a pugin. | |
* | |
* @param array $plugins | |
* | |
* @return array | |
*/ | |
add_filter( 'site_option_active_sitewide_plugins', function ( $plugins ) { | |
return array_merge( $plugins, [ | |
'akismet/akismet.php' | |
] ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment