Skip to content

Instantly share code, notes, and snippets.

@ryanjbonnell
Created November 7, 2013 16:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanjbonnell/7357775 to your computer and use it in GitHub Desktop.
Save ryanjbonnell/7357775 to your computer and use it in GitHub Desktop.
Disable WordPress Plugins in Local Environment
<?php
/**
* Plugin Name: Disable Plugins in Local Environment
* Plugin URI:
* Description: Blacklist of Plugins to Disable When Working Locally
* Version: 0.1
* Author: Ryan J. Bonnell
* Author URI: https://gist.github.com/ryanjbonnell/
* License: WTFPL
* License URI: http://www.wtfpl.net/txt/copying/
*/
if ( defined( 'WP_ENV_LOCAL' ) && WP_ENV_LOCAL ) {
$disabled_plugins = array(
'backupwordpress/backupwordpress.php',
'term-menu-order/term-menu-order.php',
'jetpack/jetpack.php',
);
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
deactivate_plugins( $disabled_plugins );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment