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

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

#54798: Check for int in menu priority implementation
 Reporter:  kirtan95        |      Owner:  (none)
     Type:  defect (bug)    |     Status:  assigned
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:                  |
 Similar to [https://core.trac.wordpress.org/ticket/48249], this ticket
 focuses on ensuring that devs don't accidentally pass non-integer values
 in the position argument.

 A similar issue was also reported in
 [https://core.trac.wordpress.org/ticket/40927], where passing a float
 argument in `add_menu_page` causes to override menu item.

 For backward compatibility, I'd like to suggest informing users with
 `_doing_it_wrong` if a non-integer value is passed.

 Optionally, we can also typecast float to string to ensure in case someone
 has passed float value, at least it doesn't override menus.

Ticket URL: <https://core.trac.wordpress.org/ticket/54798>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list