Ticket #13220: highlight_home_link.4.2.2.diff
File highlight_home_link.4.2.2.diff, 1.2 KB (added by , 14 years ago) |
---|
-
wp-includes/nav-menu-template.php
69 69 $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; 70 70 71 71 $classes = $value = ''; 72 73 72 $classes = array( 'menu-item', 'menu-item-type-'. $item->type, $item->classes ); 74 73 75 74 if ( 'custom' != $item->object ) 76 75 $classes[] = 'menu-item-object-'. $item->object; 77 76 78 if ( $item->object_id == $wp_query->get_queried_object_id() ) 77 // Get the requested url 78 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 79 80 // remove any anchor links 81 $item_url = strpos( $item->url, '#' ) ? substr( $item->url, 0, strpos( $item->url, '#' ) ) : $item->url; 82 83 if ( $item->object_id == $wp_query->get_queried_object_id() || ( 'custom' == $item->object && $item_url == $current_url ) ) 79 84 $classes[] = 'current-menu-item'; 80 85 81 86 // @todo add classes for parent/child relationships … … 289 294 return call_user_func_array( array(&$walker, 'walk'), $args ); 290 295 } 291 296 292 ?> 297 ?> 298 No newline at end of file