#11416 closed defect (bug) (invalid)
Comments menu item cannot be removed
Reported by: | shadd | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.8.5 |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
I am creating a plugin to remove some menu items from the administrator panel. It works perfectly on every menu item except the 'comments' menu item. No matter what I do, it does not disappear. Code attached:
global $menu, $submenu, $user_ID;
$the_user = new WP_User($user_ID);
reset($menu); $page = key($menu);
/*Get Menu Item*/
while (('Comments' != $menu[$page][0]) && next($menu)) {
$page = key($menu);
}
/*Unset Menu Item*/
if ('Comments' == $menu[$page][0]) {
unset($menu[$page]);
}
Change History (2)
Note: See
TracTickets for help on using
tickets.
try unset($GLOBALSmenu?[$page]), and please take this to the wp support forum.