[wp-trac] [WordPress Trac] #54798: Check for int in menu priority

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


#54798: Check for int in menu priority
---------------------------------------------+-----------------------
 Reporter:  kirtan95                         |       Owner:  audrasjb
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:  6.0
Component:  Administration                   |     Version:
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+-----------------------
Changes (by audrasjb):

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


Comment:

 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/54798#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list