[wp-trac] [WordPress Trac] #15633: Add class to custom menu item when menu url is found in current page

WordPress Trac noreply at wordpress.org
Fri Sep 18 13:20:12 UTC 2015


#15633: Add class to custom menu item when menu url is found in current page
-------------------------+-------------------------------
 Reporter:  elBradford   |       Owner:  celloexpressions
     Type:  enhancement  |      Status:  reviewing
 Priority:  normal       |   Milestone:  4.4
Component:  Menus        |     Version:  3.0.2
 Severity:  normal       |  Resolution:
 Keywords:  close        |     Focuses:
-------------------------+-------------------------------
Changes (by tyxla):

 * keywords:  needs-patch => close


Comment:

 Confirmed. In case the current URL matches the URL of a custom menu item,
 the `current-menu-item` class is added to that item.

 That can be observed in `_wp_menu_item_classes_by_context()` in `/wp-
 includes/nav-menu-template.php`:

 https://core.trac.wordpress.org/browser/trunk/src/wp-includes/nav-menu-
 template.php#L556

 So I agree with @celloexpressions on closing this ticket.

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


More information about the wp-trac mailing list