[wp-trac] [WordPress Trac] #45361: Integer menu slugs should not be supported

WordPress Trac noreply at wordpress.org
Fri Sep 13 17:58:08 UTC 2019


#45361: Integer menu slugs should not be supported
-------------------------------------------------+-------------------------
 Reporter:  desrosj                              |       Owner:  desrosj
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  5.3
Component:  Menus                                |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit      |     Focuses:
  needs-dev-note                                 |
-------------------------------------------------+-------------------------
Changes (by desrosj):

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


Comment:

 In [changeset:"46102" 46102]:
 {{{
 #!CommitTicketReference repository="" revision="46102"
 Menus: Nav menu locations should not be integers.

 When nav menu location slugs are integers, some hard to debug results can
 occur. `register_nav_menus()` utilizes `array_merge()` which renumbers
 numeric indexes, starting from 0. Because of this, numeric menu locations
 will almost always be changed.

 This change introduces a `_doing_it_wrong()` notice to inform developers
 that nav menu locations should always be strings.

 Props audrasjb, desrosj, welcher.
 Fixes #45361.
 }}}

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


More information about the wp-trac mailing list