Created
July 23, 2015 08:33
-
-
Save jdevalk/a14feed54da74e287074 to your computer and use it in GitHub Desktop.
Throw this in your dev environments mu-plugins folder and add it to your .gitignore file :)
This file contains hidden or 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 | |
| /** | |
| * Disables plugins on your dev environment | |
| * | |
| * @param $plugins | |
| * | |
| * @return mixed | |
| */ | |
| function yst_dev_env_disable_plugins( $plugins ) { | |
| $disabled_plugins = array( | |
| 'wp-google-authenticator/wp-google-authenticator.php', | |
| 'configure-smtp/configure-smtp.php', | |
| ); | |
| foreach ( $plugins as $key => $plugin ) { | |
| if ( in_array( $plugin, $disabled_plugins ) ) { | |
| unset( $plugins[ $key ] ); | |
| } | |
| } | |
| return $plugins; | |
| } | |
| add_filter( 'option_active_plugins', 'yst_dev_env_disable_plugins' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment