[wp-trac] [WordPress Trac] #11416: Comments menu item cannot be removed

WordPress Trac wp-trac at lists.automattic.com
Sun Dec 13 00:53:51 UTC 2009


#11416: Comments menu item cannot be removed
----------------------------+-----------------------------------------------
 Reporter:  shadd           |       Owner:            
     Type:  defect (bug)    |      Status:  new       
 Priority:  normal          |   Milestone:  Unassigned
Component:  Administration  |     Version:  2.8.5     
 Severity:  normal          |    Keywords:            
----------------------------+-----------------------------------------------
 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]);
 }

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11416>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list