Weird, and seemingly incorrect, classes on menu items
|Reported by:||nathanrice||Owned by:||filosofo|
Forgive me if this has been reported already, but I couldn't find anything. After looking at the source output of a nav menu (in various contexts), I see some inconsistency in the class output for individual menu items.
(BTW, using the latest trunk as of 5:30pm Eastern)
For instance, when I put a Home menu item in a menu, then view the homepage, that menu item has the following classes applied:
class="menu-item menu-item-type-custom current-menu-item menu-item-home current_page_item"
However, when I click over to another page, the Home menu item class output changes to this:
That's all fine, except I would assume that the 'menu-item-home' should stay on that menu item, since it is telling us that this is the "home menu item". I wouldn't think that class should change.
Also, when I put a page (let's say an "About Me" page menu item in the menu, the class output is something like this:
Shouldn't that second class be "menu-item-type-page" instead? The 'post_type' output seems like a bug.
Finally, when a menu item has children (or grandchildren, etc.), why isn't there something in the class string to indicate this? Like 'menu-item-parent' or 'menu-item-ancestor' ???
#12812 was a good start, but I can conceive a scenario where I'd like to do something special to pages that have submenu items, even if the page itself (or its subpages) don't happen to be the current active menu item.
I don't have a patch. But I feel like this might at least get the conversation going.
Change History (15)
- Keywords has-patch added; needs-patch removed
- Milestone changed from Unassigned to 3.0.1
- Version set to 3.0
- Milestone changed from Awaiting Triage to 3.1
- Owner set to filosofo
- Status changed from new to assigned