Skip to content

Instantly share code, notes, and snippets.

@dannyconnolly
Created January 23, 2014 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannyconnolly/8575310 to your computer and use it in GitHub Desktop.
Save dannyconnolly/8575310 to your computer and use it in GitHub Desktop.
Hide plugins from admin menu even for administrators
/*
* Hide plugins
*/
function hide_essential_plugins() {
global $wp_list_table;
$hidearr = array('plugin_name', 'plugin_name');
$myplugins = $wp_list_table->items;
foreach ($myplugins as $key => $val) {
if (in_array($key,$hidearr)){
unset($wp_list_table->items[$key]);
}
}
}
add_action( 'pre_current_active_plugins', 'hide_essential_plugins' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment