Opened 16 years ago
Closed 16 years ago
#16605 closed defect (bug) (invalid)
wp_nav_menu fallback_cb argument ignored with using menu argument
| Reported by: | jonkirkman | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Menus | Version: | 3.0.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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
@
16 years ago
- Keywords needs-patch 2nd-opinion removed
- Milestone Awaiting Review
- Resolution → invalid
- Status new → closed
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.