Skip to content

Commit

Permalink
Prevent NextGEN Gallery from activating itself #13
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Feb 15, 2022
1 parent cdd791b commit ae3dc4b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions includes/oik-loader-mu.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function oik_loader_mu_loaded() {
$plugins = oik_loader_plugin_dependencies( $plugins );
oik_loader_load_plugins( $plugins );
add_filter( "option_active_plugins", "oik_loader_option_active_plugins", 10, 2 );
add_action( "shutdown", "oik_loader_shutdown", 2 );
}

}
Expand Down Expand Up @@ -280,4 +281,11 @@ function oik_loader_mu_query_plugins_for_query( $index ) {
$plugins = oik_loader_mu_query_plugins($index, $querystring);
}
return $plugins;
}

function oik_loader_shutdown() {
remove_filter( "option_active_plugins", "oik_loader_option_active_plugins", 10);
// Trick NextGEN Gallery into thinking a plugin's been activated;
// causing C_NextGEN_Bootstrap::fix_loading_order() to return early.
do_action( 'activate_plugin', __FILE__);
}

0 comments on commit ae3dc4b

Please sign in to comment.