Created
July 19, 2012 22:01
-
-
Save jasonferrier/3147174 to your computer and use it in GitHub Desktop.
Wordpress - disable plugins on local/preview environments
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 | |
// 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