[wp-trac] [WordPress Trac] #24035: in WP 3.5.1, filter wp_nav_menu_items is never called on empty menus

WordPress Trac noreply at wordpress.org
Thu Apr 11 15:25:46 UTC 2013


#24035: in WP 3.5.1, filter wp_nav_menu_items is never called on empty menus
--------------------------+------------------------------
 Reporter:  mykle         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Menus         |     Version:  3.5
 Severity:  normal        |  Resolution:
 Keywords:  close         |
--------------------------+------------------------------
Changes (by DrewAPicture):

 * keywords:   => close
 * severity:  major => normal


Comment:

 This is intended behavior. If the menu is empty, don't display the markup.

 > The comment at line 174 claims we will fallback on empty menus only if
 no theme_location is specified, and we do test that on line 177, but on
 line 181 we test again and fallback on empty menus without checking
 theme_location.

 We 'test again' after the fallback callback is fired, which I'd argue is
 what you should be using to bring menu items in to an empty menu. As noted
 in #21576, outputting empty markup for menus can wreak havoc on theme
 styling that relies on `wp_nav_menu` falling back to the callback.

 Suggest close.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24035#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list