Make WordPress Core

Opened 7 years ago

Last modified 7 years ago

#39558 new enhancement

A lot of menu classes (and id's) are missing when there's no menu set for a location

Reported by: benoitchantre's profile benoitchantre Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7
Component: Menus Keywords:
Focuses: template Cc:


When a fallback menu is displayed because no menu is set to a location, a lot of the CSS classes are removed, compared to the same menu when the location is set.

Would it be possible for a fallback menu to have the same classes than a menu with a location?
It would allow theme developers to use classes instead of tags to style the menu.

Fallback menu

<div id="primary-menu" class="menu">
		<li class="page_item page-item-3"><a href="">Accueil</a></li>
		<li class="page_item page-item-703"><a href="">Blog</a></li>
		<li class="page_item page-item-4"><a href="">Contact</a></li>
		<li class="page_item page-item-701 current_page_item"><a href="">Front Page</a></li>
		<li class="page_item page-item-2 page_item_has_children"><a href="">About The Tests</a>
			<ul class="children">
				<li class="page_item page-item-1133"><a href="">Page Image Alignment</a></li>
				<li class="page_item page-item-1134"><a href="">Page Markup And Formatting</a></li>
				<li class="page_item page-item-501"><a href="">Clearing Floats</a></li>
				<li class="page_item page-item-155"><a href="">Page with comments</a></li>
				<li class="page_item page-item-156"><a href="">Page with comments disabled</a></li>
		<li class="page_item page-item-174 page_item_has_children"><a href="">Level 1</a>
			<ul class="children">
				<li class="page_item page-item-173 page_item_has_children"><a href="">Level 2</a></li>
				<li class="page_item page-item-742"><a href="">Level 2a</a></li>
				<li class="page_item page-item-744"><a href="">Level 2b</a></li>
		<li class="page_item page-item-146"><a href="">Lorem Ipsum</a></li>
		<li class="page_item page-item-733"><a href="">Page A</a></li>
		<li class="page_item page-item-735"><a href="">Page B</a></li>

Menu with a location

<div class="menu-container">
	<ul id="primary-menu" class="menu">
		<li id="menu-item-1708" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-home current-menu-item page_item page-item-701 current_page_item menu-item-1708"><a href="">Front Page</a></li>
		<li id="menu-item-1705" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1705"><a href="">Level 1</a></li>
		<li id="menu-item-1706" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-1706"><a href="">Level 2</a>
		<ul class="sub-menu">
			<li id="menu-item-1709" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1709"><a href="">Level 2a</a></li>
			<li id="menu-item-1710" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-1710"><a href="">Level 2b</a></li>
		<li id="menu-item-1713" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1713"><a href="">Contact</a></li>

Change History (1)

Note: See TracTickets for help on using tickets.