Last active
January 1, 2016 06:29
-
-
Save JulioPotier/8105579 to your computer and use it in GitHub Desktop.
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: 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