Last active
June 15, 2016 15:09
-
-
Save dipakcg/eb083c293b3feee2fa444be0c4913b5d to your computer and use it in GitHub Desktop.
WordPress - Hide plugin from plugins (list) page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ========================================== | |
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