Hide a plugin from the plugin list so it can´t accidently be deactivated (if it´s function is important) - without plugin. Does NOT hide plugin menus. Credits: http://www.trickspanda.com/2014/02/hide-wordpress-plugin-plugin-list/
// For multiple plugins you can use an array like this - replaces line 3 in 01
$hidearr = array();
$hidearr[] = array('plugin-directory/plugin-file.php');
$hidearr[] = array('plugin-directory/plugin-file.php');
// For networks
function mu_hide_plugins_network( $plugins ) {
// let's hide akismet
if( in_array( 'akismet/akismet.php', array_keys( $plugins ) ) ) {
unset( $plugins['akismet/akismet.php'] );
}
return $plugins;
}
add_filter( 'all_plugins', 'mu_hide_plugins_network' );
function hide_plugin() {
global $wp_list_table;
$hidearr = array('plugin-directory/plugin-file.php');
$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_plugin');