Opened 15 years ago
Closed 15 years ago
#16605 closed defect (bug) (invalid)
wp_nav_menu fallback_cb argument ignored with using menu argument
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.0.1 |
| Component: | Menus | Keywords: | |
| Focuses: | Cc: |
Description
wp_nav_menu ignores the fallback_cb argument when also using the menu argument.
If this is the expected behavior, it should be documented as it isn't intuitive.
This fails to honor the fallback_cb -
wp_nav_menu(array('menu' => 'mymenu', 'container' => 'false', 'fallback_cb' => ''));
This works as expected -
wp_nav_menu(array('theme_location' => 'mylocation', 'container' => 'false', 'fallback_cb' => ''));
Change History (1)
#1
in reply to:
↑ description
@
15 years ago
- Keywords needs-patch 2nd-opinion removed
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
Replying to jonkirkman:
It is documented in the PHPDoc for
wp_nav_menu. Is there somewhere else that it isn't documented correctly? (Codex has it, too.)To elaborate, because you're specifying the menu, the only time the
fallback_cbwould apply is if that menu doesn't exist. In contrast, when you don't specify the menu, until one is assigned to that location thefallback_cbdoes apply.