[wp-trac] [WordPress Trac] #56926: Infinite loop in wp_nav_menu

WordPress Trac noreply at wordpress.org
Mon Dec 19 00:00:06 UTC 2022


#56926: Infinite loop in wp_nav_menu
-------------------------------------------------+-------------------------
 Reporter:  david.binda                          |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.1.2
Component:  Menus                                |     Version:  6.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests fixed-      |     Focuses:
  major                                          |
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 In [changeset:"55005" 55005]:
 {{{
 #!CommitTicketReference repository="" revision="55005"
 Menus: Account for legacy calls to `nav_menu_css_class` filter.

 Modify `wp_nav_menu_remove_menu_item_has_children_class()` to account for
 changes to the `nav_menu_css_class` filter since it's introduction.

 The `$args` and `$depth` parameters were added after the filter's
 introduction so this protects against fatal errors in custom walkers
 applying the filter in a legacy format.

 Without the `$args` or `$depth` parameters,
 `wp_nav_menu_remove_menu_item_has_children_class()` no longer attempts to
 remove the `menu-item-has-children` from the lowest level menu items as
 these are required to determine the current branch the walker is walking.

 Follow up to [54999].

 Props dd32, azaozz, peterwilsoncc.
 See #56926, #28620.
 }}}

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


More information about the wp-trac mailing list