[wp-trac] [WordPress Trac] #15777: Add a filter to allow a menu item to be manually selected

WordPress Trac noreply at wordpress.org
Thu Jan 24 16:23:56 UTC 2013


#15777: Add a filter to allow a menu item to be manually selected
---------------------------+----------------------
 Reporter:  aaroncampbell  |       Owner:
     Type:  enhancement    |      Status:  closed
 Priority:  normal         |   Milestone:
Component:  Menus          |     Version:  3.0
 Severity:  normal         |  Resolution:  wontfix
 Keywords:                 |
---------------------------+----------------------
Changes (by aaroncampbell):

 * keywords:  3.2-early close reporter-feedback =>
 * status:  new => closed
 * resolution:   => wontfix
 * milestone:  Future Release =>


Comment:

 So all the classes are added in `_wp_menu_item_classes_by_context()` which
 is called [http://core.trac.wordpress.org/browser/trunk/wp-includes/nav-
 menu-template.php#L198 on line 198 of nav-menu-template.php].  The filter
 you're talking about using is on line 206, which means that in that loop
 I'd need to unset all the previous classes ('current-menu-item', 'current-
 menu-ancestor', 'current-menu-parent', etc), find the item to select, pull
 it's parents, loop through them, and re-assign proper classes.

 Basically, I'd need to create a slightly modified version of
 `_wp_menu_item_classes_by_context()` (which is about 200 lines) and use
 it.

 Having said all that, I no longer work with the publishers that I used to,
 and haven't run across the need for this in probably 18 months.  I think
 it's one of those things that felt common at the time and is actually edge
 case.  Closing as wontfix.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15777#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list