[wp-trac] [WordPress Trac] #39776: add priority argument to add_submenu_page() function

WordPress Trac noreply at wordpress.org
Tue Jun 6 03:07:53 UTC 2017


#39776: add priority argument to add_submenu_page() function
------------------------------------+------------------------------
 Reporter:  alexvorn2               |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Menus                   |     Version:  4.7.2
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  administration
------------------------------------+------------------------------
Changes (by welcher):

 * keywords:   => has-patch dev-feedback


Comment:

 Attached is an initial approach based on what is done in `add_menu_page`.
 The position numbers are not sequential, but rather multiples of 5. Adding
 a submenu item with a priority of 5 ( or lower ) will place it at the top
 of the list, 10 will be the second, 15 the third and so on.

 This is due to how the menus are generated and output in
 includes/menu.php: https://core.trac.wordpress.org/browser/tags/4.7/src
 /wp-admin/includes/menu.php

 The Appearance menu does deviate from this numbering system slightly which
 may cause some confusion when adding items to it.

 I'd love a second opinion on this approach.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39776#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list