简体   繁体   中英

how to remove/hide wordpress plugin menu from admin dashboard

i want to hide wp menu from my admin dashboard.. how remove/hide wordpress menu from admin dashboard .. i was try many code seems not work I want to hide yith_wacp_panel menu item s. How to remove yith_wacp_panel menu item in admin page? enter image description here

If you only want to hide it you can do this.

if (!function_exists('remove_menus')) {
  function remove_menus () {
    remove_menu_page('plugins.php');
  }
}
add_action('admin_menu', 'remove_menus');

Because we use a very generic function name I wrapped it in function_exists so we don't get a php error for redeclaring a function.
If this doesn't work it might be that the call back doesn't use our function, you can add a prefix, as you should anyway, to the function.
So something like this

if (!function_exists('bt_remove_menus')) {
  function bt_remove_menus () {
    remove_menu_page('plugins.php');
  }
}
add_action('admin_menu', 'bt_remove_menus');

Now with bt_ as our prefix (or anything else that you want) we are less likely to have issues

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM