Changeset 57987 for trunk/src/wp-includes/nav-menu-template.php
- Timestamp:
- 04/12/2024 05:45:23 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/nav-menu-template.php
r57236 r57987 342 342 $possible_object_parents = array_merge( $possible_object_parents, $terms ); 343 343 $term_to_ancestor = array(); 344 foreach ( (array) $term_hierarchy as $anc => $descs ) {345 foreach ( (array) $desc s as $desc ) {346 $term_to_ancestor[ $desc ] = $anc ;344 foreach ( (array) $term_hierarchy as $ancestor => $descendents ) { 345 foreach ( (array) $descendents as $desc ) { 346 $term_to_ancestor[ $desc ] = $ancestor; 347 347 } 348 348 } … … 366 366 $term_hierarchy = _get_term_hierarchy( $queried_object->taxonomy ); 367 367 $term_to_ancestor = array(); 368 foreach ( (array) $term_hierarchy as $anc => $descs ) {369 foreach ( (array) $desc s as $desc ) {370 $term_to_ancestor[ $desc ] = $anc ;368 foreach ( (array) $term_hierarchy as $ancestor => $descendents ) { 369 foreach ( (array) $descendents as $desc ) { 370 $term_to_ancestor[ $desc ] = $ancestor; 371 371 } 372 372 } … … 431 431 $classes[] = 'current-menu-item'; 432 432 $menu_items[ $key ]->current = true; 433 $ _anc_id= (int) $menu_item->db_id;433 $ancestor_id = (int) $menu_item->db_id; 434 434 435 435 while ( 436 ( $ _anc_id = (int) get_post_meta( $_anc_id, '_menu_item_menu_item_parent', true ) )437 && ! in_array( $ _anc_id, $active_ancestor_item_ids, true )436 ( $ancestor_id = (int) get_post_meta( $ancestor_id, '_menu_item_menu_item_parent', true ) ) 437 && ! in_array( $ancestor_id, $active_ancestor_item_ids, true ) 438 438 ) { 439 $active_ancestor_item_ids[] = $ _anc_id;439 $active_ancestor_item_ids[] = $ancestor_id; 440 440 } 441 441 … … 458 458 $classes[] = 'current-menu-item'; 459 459 $menu_items[ $key ]->current = true; 460 $ _anc_id= (int) $menu_item->db_id;460 $ancestor_id = (int) $menu_item->db_id; 461 461 462 462 while ( 463 ( $ _anc_id = (int) get_post_meta( $_anc_id, '_menu_item_menu_item_parent', true ) )464 && ! in_array( $ _anc_id, $active_ancestor_item_ids, true )463 ( $ancestor_id = (int) get_post_meta( $ancestor_id, '_menu_item_menu_item_parent', true ) ) 464 && ! in_array( $ancestor_id, $active_ancestor_item_ids, true ) 465 465 ) { 466 $active_ancestor_item_ids[] = $ _anc_id;466 $active_ancestor_item_ids[] = $ancestor_id; 467 467 } 468 468 … … 495 495 $classes[] = 'current-menu-item'; 496 496 $menu_items[ $key ]->current = true; 497 $ _anc_id= (int) $menu_item->db_id;497 $ancestor_id = (int) $menu_item->db_id; 498 498 499 499 while ( 500 ( $ _anc_id = (int) get_post_meta( $_anc_id, '_menu_item_menu_item_parent', true ) )501 && ! in_array( $ _anc_id, $active_ancestor_item_ids, true )500 ( $ancestor_id = (int) get_post_meta( $ancestor_id, '_menu_item_menu_item_parent', true ) ) 501 && ! in_array( $ancestor_id, $active_ancestor_item_ids, true ) 502 502 ) { 503 $active_ancestor_item_ids[] = $ _anc_id;503 $active_ancestor_item_ids[] = $ancestor_id; 504 504 } 505 505
Note: See TracChangeset
for help on using the changeset viewer.