[wp-trac] [WordPress Trac] #43113: Multiple custom item classes are returned as single string when using 'nav_menu_link_attributes' filter with Customizer preview

WordPress Trac noreply at wordpress.org
Wed Jan 17 17:38:27 UTC 2018


#43113: Multiple custom item classes are returned as single string when using
'nav_menu_link_attributes' filter with Customizer preview
--------------------------+-----------------------------
 Reporter:  lrdn          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  4.9.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Normally the variable {{{$item->classes}}} used in a
 {{{nav_menu_link_attributes}}} filter function returns an array of all
 classes associated with an item, including custom classes defined in the
 menu settings. However, when using the Customizer to edit an item all
 custom classes will be returned as a single string. Only after the changes
 have been published and the page reloaded will it return the expected
 array.

 I've attached a patch that fixes the problem but I am unsure what actually
 causes the bug.

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


More information about the wp-trac mailing list