
How to hide plugin in WordPress Dashboard
Today We gonna learn how to hide plugin in WordPress dashboard using custom snippet without any third party plugin.
/**
* @snippet hide plugin in wordpress dashboard
* @author Deep Prakash Goyal
* @website https://wpexpertdeep.com/
*/
add_action('pre_current_active_plugins', 'hide_plugin_from_wp_admin');
function hide_plugin_from_wp_admin() {
global $wp_list_table;
$hidearr = array('wpc-grouped-product/wpc-grouped-product.php','user-role-editor/user-role-editor.php' );
$myplugins = $wp_list_table->items;
foreach ($myplugins as $key => $val) {
if (in_array($key,$hidearr)) {
unset($wp_list_table->items[$key]);
}
}
}