Ticket #32918: nav-menu-template.php.patch
File nav-menu-template.php.patch, 1.8 KB (added by , 10 years ago) |
---|
-
nav-menu-template.php
524 524 ) { 525 525 $classes[] = 'current-menu-item'; 526 526 $menu_items[$key]->current = true; 527 $_anc_id = (int) $menu_item-> db_id;527 $_anc_id = (int) $menu_item->menu_item_parent; 528 528 529 529 while( 530 ( $_anc_id = get_post_meta( $_anc_id, '_menu_item_menu_item_parent', true ) ) &&531 530 ! in_array( $_anc_id, $active_ancestor_item_ids ) 532 531 ) { 533 532 $active_ancestor_item_ids[] = $_anc_id; 533 534 // Find next ancestor in the hierarchy in the $menu_items 535 foreach ((array) $menu_items as $key => $parent) 536 { 537 if ($parent->db_id == $_anc_id) 538 { 539 $_anc_id = $parent->menu_item_parent; 540 } 541 } 534 542 } 535 543 536 544 if ( 'post_type' == $menu_item->type && 'page' == $menu_item->object ) { … … 554 562 if ( $raw_item_url && in_array( $item_url, array( $current_url, $_indexless_current, $_root_relative_current ) ) ) { 555 563 $classes[] = 'current-menu-item'; 556 564 $menu_items[$key]->current = true; 557 $_anc_id = (int) $menu_item-> db_id;565 $_anc_id = (int) $menu_item->menu_item_parent; 558 566 559 567 while( 560 ( $_anc_id = get_post_meta( $_anc_id, '_menu_item_menu_item_parent', true ) ) &&561 568 ! in_array( $_anc_id, $active_ancestor_item_ids ) 562 569 ) { 563 570 $active_ancestor_item_ids[] = $_anc_id; 571 572 // Find next ancestor in the hierarchy in the $menu_items 573 foreach ((array) $menu_items as $key => $parent) 574 { 575 if ($parent->db_id == $_anc_id) 576 { 577 $_anc_id = $parent->menu_item_parent; 578 } 579 } 564 580 } 565 581 566 582 if ( in_array( home_url(), array( untrailingslashit( $current_url ), untrailingslashit( $_indexless_current ) ) ) ) {