[wp-trac] [WordPress Trac] #37344: Side effects on 'nav_menu_item_args' filter when appending to arguments

WordPress Trac noreply at wordpress.org
Sun Oct 10 23:08:44 UTC 2021


#37344: Side effects on 'nav_menu_item_args' filter when appending to arguments
----------------------------------------+-----------------------------
 Reporter:  dgwyer                      |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Future Release
Component:  Menus                       |     Version:  4.4
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+-----------------------------

Comment (by smerriman):

 Just stumbled across this bug myself. The original post says it works fine
 if you're overwriting args - just not appending them.

 This isn't true - it also fails for overwriting args. For example, if you
 overwrite an argument based on testing something in `$item`, it will
 overwrite the argument for all later menu items even if they fail that
 test.

 The filter doesn't really seem usable at all for this reason.

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


More information about the wp-trac mailing list