Ticket #13220: highlight_home_link.4.diff
File highlight_home_link.4.diff, 872 bytes (added by , 14 years ago) |
---|
-
wp-includes/nav-menu-template.php
75 75 if ( 'custom' != $item->object ) 76 76 $classes[] = 'menu-item-object-'. $item->object; 77 77 78 if ( $item->object_id == $wp_query->get_queried_object_id() ) 78 // Get the requested uri 79 $protocol = parse_url($item->url); 80 $current_url = "{$protocol['scheme']}://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; 81 82 // remove any anchors to compare 83 $item_url = preg_replace( '/#(.*)/', '', $item->url ); 84 85 if ( $item->object_id == $wp_query->get_queried_object_id() || ( 'custom' == $item->object && $item_url == $current_url ) ) 79 86 $classes[] = 'current-menu-item'; 80 87 81 88 // @todo add classes for parent/child relationships