Make WordPress Core

Opened 3 years ago

Last modified 11 months ago

#18842 new defect (bug)

wp_nav_menu confuses new developers when it falls through to page listing

Reported by: dd32 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.2.1
Component: Menus Keywords: needs-patch
Focuses: Cc:


It appears that when wp_nav_menu() falls through to a page listing, many menu-specific args are not passed to the page listing, which ultimately confuses new developers.

I seem to answer this at least weekly in #wordpress

One example is the 'container_class' arg, if it falls through to the fallback_cb, the container_class is not applied.

Ideally, template-related arguements should be passed to the fallback (And with pages as the default callback, it should handle these) or wp_nav_menu() should output any extra wrapping divs if appropriate.

Change History (4)

comment:2 coffee2code2 years ago

  • Keywords needs-patch added
  • Version set to 3.2.1

comment:3 alex-ye18 months ago

  • Cc nashwan.doaqan@… added
Note: See TracTickets for help on using tickets.