Skip to content

Instantly share code, notes, and snippets.

@dipakcg
Last active June 15, 2016 15:09
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 dipakcg/eb083c293b3feee2fa444be0c4913b5d to your computer and use it in GitHub Desktop.
Save dipakcg/eb083c293b3feee2fa444be0c4913b5d to your computer and use it in GitHub Desktop.
WordPress - Hide plugin from plugins (list) page
/* ==========================================
Put the following code at the end of wp-config.php file to hide plugin from plugins (list) page.
change line 8 with your plugin name.
========================================== */
function dcg_hide_plugin_from_dashboard() {
global $wp_list_table;
$hidearr = array('backwpup/backwpup.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', 'dcg_hide_plugin_from_dashboard');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment