[wp-trac] [WordPress Trac] #48249: Check for int instead of null in new submenu priority implementation

WordPress Trac noreply at wordpress.org
Thu Oct 17 02:24:01 UTC 2019


#48249: Check for int instead of null in new submenu priority implementation
--------------------------+-----------------------------
 Reporter:  david.binda   |       Owner:  audrasjb
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  Future Release
Component:  Menus         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------------

Comment (by dennis_f):

 In one of my plugins I have a menu with several submenu items. Only for
 **one** of the submenu items the code passes the icon option mistakenly.
 This has been working fine until 5.3 and now with 5.3 this makes **all**
 of the submenu items (even the ones that are registered correctly) to
 disappear and produces some warnings.

 The proposed patch fixes the issue, so I really hope we can see this land
 in 5.3. Of course, I'm going to fix the issue on my end as well, but I
 suppose that many others might experience the same issue due to a
 confusion of the parameters.

 This can especially cause the default WordPress submenu items to
 disappear, in cases when plugins register submenu pages incorrectly under
 the default WordPress menu items. For example, if you register a submenu
 item by passing an icon string in the Settings page, all of the default
 WordPress settings submenu items (General, Writing, Reading, etc.) will
 disappear:

 {{{#!php
 <?php
 add_submenu_page(
     'options-general.php',
     'My settings',
     'My settings',
     'manage_options',
     'my_slug',
     'my_callback',
     'my-icon'
 );
 }}}

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


More information about the wp-trac mailing list