Ticket #12812: 12812.refresh.diff
File 12812.refresh.diff, 1.0 KB (added by , 14 years ago) |
---|
-
wp-includes/nav-menu.php
459 459 * @return object $menu_item The menu item with standard menu item properties. 460 460 */ 461 461 function wp_setup_nav_menu_item( $menu_item ) { 462 global $post; 462 463 if ( isset( $menu_item->post_type ) ) { 463 464 if ( 'nav_menu_item' == $menu_item->post_type ) { 464 465 $menu_item->db_id = (int) $menu_item->ID; … … 512 513 $menu_item->attr_title = strip_tags( $menu_item->post_excerpt ); 513 514 $menu_item->description = strip_tags( $menu_item->post_content ); 514 515 $menu_item->classes = ''; 516 if (isset($post)) { 517 if ( $menu_item->object_id == $post->ancestors[0] ) 518 $menu_item->classes .= ' menu-item-parent'; 519 if ( in_array( $menu_item->object_id, array_values($post->ancestors) ) ) 520 $menu_item->classes .= ' menu-item-ancestor'; 521 } 515 522 $menu_item->xfn = ''; 516 523 } 517 524 } elseif ( isset( $menu_item->taxonomy ) ) {