#25258 closed defect (bug) (worksforme)
Notices when no items in nav menu
Reported by: | mordauk | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.6 |
Component: | Menus | Keywords: | reporter-feedback 2nd-opinion |
Focuses: | Cc: |
Description
When displaying a nav menu with wp_nav_menu()
there are a lot of notices if the nav menu is created but has no nav items:
Some sample notices shown in the attached screenshot.
Attachments (2)
Change History (6)
#1
@
11 years ago
- Keywords reporter-feedback added; needs-patch removed
Could not reproduce on a clean install:
- If there are no menu items,
wp_nav_menu()
falls back towp_page_menu()
by default:
tags/3.6/wp-includes/nav-menu-template.php#L180. - If I specify an empty
fallback_cb
parameter to disable the default fallback, then the walker is called viawalk_nav_menu_tree()
, but it bails out early if there are no items:
tags/3.6/wp-includes/class-wp-walker.php#L182.
Tested in both 3.6 and current trunk. Could you provide the exact steps to reproduce?
#2
@
11 years ago
- Keywords 2nd-opinion added
Can't reproduce here either, seems like the walker has been called on Pippin's setup and trying to work with empty $item being passed, but I can't replicate that use case either (by using the menu
or theme_location
arguments for wp_nav_menu
).
Note: See
TracTickets for help on using
tickets.
Notices