Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Activate plugins by checking the IP address of the server where our site is running.
add_filter( 'option_active_plugins', 'activate_local_plugins' );
* Add our local plugins to the list of active plugins.
function activate_local_plugins( $plugins ) {
if ( '' == $_SERVER['SERVER_ADDR'] ) {
$local_plugins = array(
foreach ( $local_plugins as $plugin ) {
$plugins[] = $plugin;
return $plugins;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment