Skip to content

Instantly share code, notes, and snippets.

@JulioPotier

JulioPotier/option_ demo

Last active Jan 1, 2016
Embed
What would you like to do?
<?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