Ticket #13994: front-page-current-class.13994.2.diff
File front-page-current-class.13994.2.diff, 1.1 KB (added by , 14 years ago) |
---|
-
wp-includes/nav-menu-template.php
313 313 314 314 $possible_object_parents = array_filter( $possible_object_parents ); 315 315 316 $front_page_url = home_url(); 317 316 318 foreach ( (array) $menu_items as $key => $menu_item ) { 317 319 318 320 $menu_items[$key]->current = false; … … 383 385 $active_parent_item_ids[] = (int) $menu_item->menu_item_parent; 384 386 $active_parent_object_ids[] = (int) $menu_item->post_parent; 385 387 $active_object = $menu_item->object; 388 389 // give front page item current-menu-item class when extra query arguments involved 390 } elseif ( $item_url == $front_page_url && is_front_page() ) { 391 $classes[] = 'current-menu-item'; 386 392 } 387 393 388 394 if ( untrailingslashit($item_url) == home_url() ) … … 477 483 $_used_ids[] = $item->ID; 478 484 return $id; 479 485 } 480 add_filter( 'nav_menu_item_id', '_nav_menu_item_id_use_once', 10, 2 ); 481 No newline at end of file 486 add_filter( 'nav_menu_item_id', '_nav_menu_item_id_use_once', 10, 2 );