Opened 3 years ago
Last modified 16 months ago
#14687 new feature request
Add "collapsible" class to menu items that have children
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Menus | Version: | 3.0.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | mike@…, matt@… |
Description
Items from custom menus in WP 3 have classes like:
menu-item menu-item-type-TYPE menu-item-ID
and if the current menu item is active, also:
current-menu-item
or
current-menu-ancestor
It would useful for theme developers if you also added another class on menu items that have children, like "collapsible", or "menu-with-children" :)
this will allow designers to add things like arrows in menus easier, without having to resort to javascript hacks to check if the list element has children...
Attachments (1)
Change History (6)
comment:2
mobius5150
— 2 years ago
- Cc mike@… added
- Keywords has-patch added
- Version changed from 3.0.1 to 3.2
comment:3
SergeyBiryukov
— 22 months ago
- Version changed from 3.2 to 3.0.1
Version number is used to track when the bug was initially reported.
comment:5
cramdesign
— 16 months ago
- Cc matt@… added
The patch looks great. Does this ticket still have any traction? Nacin's post was so long ago.
I found this while I was looking for a way to style parent menu items without using nasty javascript. I found a very nice solution here (basically taking the two added lines from this and adding it to the default WalkerNavMenu->display_element() function which simply checks to see if the menu item has children, and if so, appends the appropriate class to it.
I'll be preparing and attaching a patch ASAP.