Skip to content

Instantly share code, notes, and snippets.

@shahzaibkhan
Created June 30, 2022 04:58
Show Gist options
  • Save shahzaibkhan/aa0369c963b5dabcd607dab64b658c00 to your computer and use it in GitHub Desktop.
Save shahzaibkhan/aa0369c963b5dabcd607dab64b658c00 to your computer and use it in GitHub Desktop.
Hide plugins from the WordPressAdmin plugin list
<?php
function plugin_hide() {
global $wp_list_table;
// replace your plugin url here
$hidearr = array('advanced-custom-fields/acf.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', 'plugin_hide');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment