Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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