Skip to content

Instantly share code, notes, and snippets.

@JulioPotier
Last active January 1, 2016 06:29
Show Gist options
  • Save JulioPotier/8105579 to your computer and use it in GitHub Desktop.
Save JulioPotier/8105579 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Do not load this plugins
Description: Do not load this plugins on wp-login.php page
Author: Julio Potier
*/
add_action( 'muplugins_loaded', 'pre_baw_do_not_load_this_plugin' );
function pre_baw_do_not_load_this_plugin() {
if( '/wp-login.php' == $_SERVER['SCRIPT_NAME'] ) {
add_filter( 'option_active_plugins', 'baw_do_not_load_this_plugin' );
}
}
function baw_do_not_load_this_plugin( $plugins ) {
$do_not_load_this = array( 'wp-rocket/wp-rocket.php', 'hello.php' );
$plugins = array_diff( $plugins, $do_not_load_this );
return $plugins;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment