WordPress.org

Make WordPress Core

Changeset 16742


Ignore:
Timestamp:
12/06/2010 03:54:57 AM (7 years ago)
Author:
markjaquith
Message:

Highlight home page Custom Nav Menu item even when extra query args are present in the URL (only if all other highlights fail). props filosofo. fixes #13994

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/nav-menu-template.php

    r16731 r16742  
    312312    $possible_object_parents = array_filter( $possible_object_parents );
    313313
     314    $front_page_url = home_url();
     315
    314316    foreach ( (array) $menu_items as $key => $menu_item ) {
    315317
     
    382384                $active_parent_object_ids[] = (int) $menu_item->post_parent;
    383385                $active_object = $menu_item->object;
     386
     387            // give front page item current-menu-item class when extra query arguments involved
     388            } elseif ( $item_url == $front_page_url && is_front_page() ) {
     389                $classes[] = 'current-menu-item';
    384390            }
    385391
Note: See TracChangeset for help on using the changeset viewer.