[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 16:46:31 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 |
--------------------------+------------------------------
Comment (by mykle):
When the theme location is specified, the fallback is not fired.
I would argue (politely!) that the menu filters are for changing the
contents of a menu, and that adding contents to an empty menu is just as
legitimate a use of those filters as any other. If that's true, then you
can't really say a menu is empty until you've called its filters. That
has been normal behavior up to 3.5 .
Furthermore: the doc specifies the purpose of the callback is for "if a
menu doesn't exist". In this case the menu definitely exists, and simply
has no contents until after the filters fire.
If the menu is still empty after its filters run, it should certainly not
be output. But otherwise, this change silently deactivates a long-
standing WP feature.
But maybe we're doing it wrong. What's a better approach to populating an
empty menu via a plugin?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24035#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list