Skip to content

Instantly share code, notes, and snippets.

@jasonferrier
Created July 19, 2012 22:01
Show Gist options
  • Save jasonferrier/3147174 to your computer and use it in GitHub Desktop.
Save jasonferrier/3147174 to your computer and use it in GitHub Desktop.
Wordpress - disable plugins on local/preview environments
<?php
// Turn of subscribe2 for local
switch ($_SERVER['HTTP_HOST'])
{
case 'domain.com.dev':
case 'domain.flickerbox.com':
case 'domain.' . $local_network[1] . '.flickerbox.local':
case (bool) preg_match("/^(stage\.)?domain\.([a-z]+)\.flickerbox\.local/i", $_SERVER['HTTP_HOST']):
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
deactivate_plugins('subscribe2/subscribe2.php');
break;
default:
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment