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

WordPress Trac noreply at wordpress.org
Sun Sep 22 11:22:06 UTC 2019


#39776: add priority argument to add_submenu_page() function
-------------------------------------------------+-------------------------
 Reporter:  alexvorn2                            |       Owner:  welcher
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  5.3
Component:  Menus                                |     Version:  4.7.2
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests commit      |     Focuses:
  needs-dev-note                                 |  administration
-------------------------------------------------+-------------------------
Changes (by MattyRob):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Forgive me if I'm missing something massively obvious here but...

 New line 1380 is as follows:
 `if ( $position >= count( $submenu[ $parent_slug ] ) ) {`

 $pareng_slug is passed as a string to the code WordPress functions like
 `add_menu_page` and `add_submenu_page`.

 So, since these changes I'm seeing the following in my localhost admin:

 {{{
 Notice: Undefined index: s2 in /**/dev/src/wp-admin/includes/plugin.php on
 line 1380

 Warning: count(): Parameter must be an array or an object that implements
 Countable in /**/dev/src/wp-admin/includes/plugin.php on line 1380
 }}}

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


More information about the wp-trac mailing list