#62747 closed defect (bug) (wontfix)
Bad behavior of wp_nav_menu
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | trunk |
Component: | Menus | Keywords: | has-screenshots |
Focuses: | Cc: |
Description
The menu of the theme that was displayed correctly up to 6.7.1 breaks down in 6.7.2.
I investigated the cause and found that in 6.7.2, wp_nav_menu is surrounded by a div by default. Until now, div was not supposed to be used unless a container was specified.
6.7.2-alpha-59547
theme original-theme(Theme in progress)
6.7.1 no problems
Attachments (3)
Change History (6)
Note: See
TracTickets for help on using
tickets.
It looks like for 6.7.1, you have a menu assigned to your menu location, but in 6.7.2-alpha-59547, there is no menu assigned, so it is falling back to the value of
fallback_cb
which iswp_page_menu
?It is a known issue that the behavior of
wp_page_menu
is sometimes inconsistent with the behavior ofwp_nav_menu
. See: #18842, #14614, #13998.I don't think anything changed for
wp_nav_menu
(orwp_page_menu
) between 6.7.1 and 6.7.2-alpha-59547.Personally I prefer to set
fallback_cb
toFALSE
to avoid dealing withwp_page_menu
entirely:https://github.com/siliconforks/wordpress-examples/blob/513a2654f8420ef746d4ce8696f0450bb6f062e9/themes/example-minimal/header.php#L57-L71
You could also write your own custom fallback function.