[wp-trac] [WordPress Trac] #33703: Menu Class: current_sub_item

WordPress Trac noreply at wordpress.org
Fri Sep 4 09:18:27 UTC 2015


#33703: Menu Class: current_sub_item
-------------------------+------------------------------
 Reporter:  atomicjack   |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Menus        |     Version:  trunk
 Severity:  normal       |  Resolution:  worksforme
 Keywords:  close        |     Focuses:  ui
-------------------------+------------------------------
Changes (by atomicjack):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 Replying to [comment:5 swissspidy]:
 > Yikes, I was somehow thinking of admin menus...
 >
 > I don't see how this shouldn't be possible for custom menus though.
 >
 > You could use `.sub-menu .current-menu-item` or `.current-menu-ancestor
 .current-menu-item` to get only current sub menu items. Using selectors
 like `.menu-item > ul > .current-menu-item` or `.menu-item > ul > li > ul
 .current-menu-item` you can even target specific levels of nested sub menu
 items. CSS is very powerful in this regard.

 Got it, a little differently to what you put though, it won't work
 following those nested classes for some reason.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33703#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list