[wp-trac] [WordPress Trac] #23767: remove_menu_page: Check for existing menu items

WordPress Trac noreply at wordpress.org
Fri Mar 15 07:46:44 UTC 2013


#23767: remove_menu_page: Check for existing menu items
------------------------------+------------------------------
 Reporter:  sergej.mueller    |       Owner:
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Warnings/Notices  |     Version:  3.5
 Severity:  normal            |  Resolution:
 Keywords:  has-patch close   |
------------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:  has-patch => has-patch close
 * version:  trunk => 3.5
 * type:  feature request => enhancement


Comment:

 Looks like there are only two ways to get this warning:
 1. Call `remove_menu_page()` after the admin is fully loaded, but before
 `$menu` global is set up, e.g. by hooking into `auth_redirect` action
 instead of `admin_menu`, which goes against the Codex example:
 http://codex.wordpress.org/Function_Reference/remove_menu_page.
 2. Manually unset the `$menu` global at some point.

 Both are developer errors, so the developer should see the warning.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23767#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list