[wp-trac] [WordPress Trac] #16212: show_in_menu swaps position with custom menu_page

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 13 00:59:38 UTC 2011


#16212: show_in_menu swaps position with custom menu_page
--------------------------+-----------------------------
 Reporter:  WraithKenny   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.1
 Severity:  minor         |   Keywords:
--------------------------+-----------------------------
 Steps:

  1. hook add_menu_page to admin_menu with menu_slug set to
 'custom_menu_page' or somesuch
  2. hook register_post_type to init with show_in_menu set to the above
 custom menu page.

 Expected:

 The post_type page should be a subpage of the custom menu page.

 Actual:

 The post type assumes the top level spot, and the menu page ends up as a
 sub.

 Additional Info:

 This is due to post types being usually being hooked at init (first),
 while add_menu_page is usually tied to admin_menu (second). The
 add_submenu_page function (used by the show_in_menu arg) assigns position
 by order of registration. I can't think of any solution other then
 allowing ordering of add_submenu_page.

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


More information about the wp-trac mailing list