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

WordPress Trac noreply at wordpress.org
Wed Jan 12 23:23:55 UTC 2022


#48249: Check for int instead of null in new submenu priority implementation
-------------------------------------------------+-------------------------
 Reporter:  david.binda                          |       Owner:  desrosj
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  5.3
Component:  Administration                       |     Version:  5.3
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch commit dev-reviewed i18n-  |     Focuses:
  change                                         |
-------------------------------------------------+-------------------------

Comment (by audrasjb):

 In [changeset:"52569" 52569]:
 {{{
 #!CommitTicketReference repository="" revision="52569"
 Administration: Ensure an integer is used for menu priority in
 `add_menu_page()`.

 This change adds a verification of the `$position` parameter in
 `add_menu_page()` to ensure an integer is used. If not, the function
 informs developers of the wrong parameter type via a `_doing_it_wrong`
 message. This brings consistency with a similar check used in
 `add_submenu_page()`.

 This change also typecasts any floating number to string to ensure that in
 case a float value was passed, at least it doesn't override existing
 menus.

 Follow-up to [46570].

 Props kirtan95.
 Fixes #54798. See #48249.
 }}}

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


More information about the wp-trac mailing list