Changeset 14457
- Timestamp:
- 05/04/2010 10:01:56 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/nav-menu-template.php
r14450 r14457 73 73 $classes = array( 'menu-item', 'menu-item-type-'. $item->type, $item->classes ); 74 74 75 if ( 'custom' != $item->object ) 75 if ( 'custom' == $item->object ) { 76 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 77 $item_url = strpos( $item->url, '#' ) ? substr( $item->url, 0, strpos( $item->url, '#' ) ) : $item->url; 78 if ( $item_url == $current_url ) 79 $classes[] = 'current-menu-item'; 80 } else { 76 81 $classes[] = 'menu-item-object-'. $item->object; 77 78 if ( $item->object_id == $wp_query->get_queried_object_id() )79 $classes[] = 'current-menu-item';82 if ( $item->object_id == $wp_query->get_queried_object_id() ) 83 $classes[] = 'current-menu-item'; 84 } 80 85 81 86 // @todo add classes for parent/child relationships
Note: See TracChangeset
for help on using the changeset viewer.