Last active
July 19, 2019 14:21
-
-
Save heyfletch/07a3677f69f94a02aaa02621075e5d6e to your computer and use it in GitHub Desktop.
Actually, I created a plugin here: https://github.com/heyfletch/fd-disable-local-plugins
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 | |
/* | |
Plugin Name: Deactivate Plugins in Development | |
Plugin URI: https://gist.github.com/heyfletch/07a3677f69f94a02aaa02621075e5d6e | |
Description: Create a list of plugins to deactivate on local development. Doesn't effect production plugins. | |
Author: Fletcher Digital | |
Version: 0.1 | |
Author URI: https://fletcherdigital.com | |
*/ | |
/* Disable specified plugins in development environment */ | |
if (defined('WP_ENV') && WP_ENV == 'development') { | |
$plugins = array( | |
'autoptimize/autoptimize.php', | |
'cloudflare/cloudflare.php', | |
'google-analytics-for-wordpress/googleanalytics.php', | |
'limit-login-attempts-reloaded/limit-login-attempts-reloaded.php', | |
); | |
require_once(ABSPATH . 'wp-admin/includes/plugin.php'); | |
deactivate_plugins($plugins); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment