Skip to content

Instantly share code, notes, and snippets.

@frozzare
Last active November 18, 2015 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save frozzare/a976bc1bcb15d1c81156 to your computer and use it in GitHub Desktop.
Save frozzare/a976bc1bcb15d1c81156 to your computer and use it in GitHub Desktop.
<?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