Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Created July 23, 2015 08:33
Show Gist options
  • Select an option

  • Save jdevalk/a14feed54da74e287074 to your computer and use it in GitHub Desktop.

Select an option

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 :)
<?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