Changeset 55701
- Timestamp:
- 05/02/2023 10:55:57 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r55694 r55701 7654 7654 $term_ids = array(); 7655 7655 if ( $prime_post_terms ) { 7656 $prime_term_ids = array();7657 $prime_taxonomy_ids = array();7658 7656 foreach ( $prime_post_terms as $taxonomy => $post_ids ) { 7659 7657 $cached_term_ids = wp_cache_get_multiple( $post_ids, "{$taxonomy}_relationships" ); … … 7664 7662 foreach ( $_term_ids as $term_id ) { 7665 7663 if ( is_numeric( $term_id ) ) { 7666 $prime_term_ids[] = (int) $term_id; 7667 $prime_taxonomy_ids[ $taxonomy ][] = (int) $term_id; 7664 $term_ids[] = (int) $term_id; 7668 7665 } elseif ( isset( $term_id->term_id ) ) { 7669 $prime_taxonomy_ids[ $taxonomy ][] = (int) $term_id->term_id; 7670 $prime_term_ids[] = (int) $term_id->term_id; 7666 $term_ids[] = (int) $term_id->term_id; 7671 7667 } 7672 7668 } … … 7674 7670 } 7675 7671 } 7676 7677 if ( $prime_term_ids ) { 7678 $prime_term_ids = array_unique( $prime_term_ids ); 7679 // Do not prime term meta at this point, let the lazy loader take care of that. 7680 _prime_term_caches( $prime_term_ids, false ); 7681 7682 foreach ( $prime_taxonomy_ids as $taxonomy => $_term_ids ) { 7683 foreach ( $_term_ids as $term_id ) { 7684 if ( in_array( $term_id, $term_ids, true ) ) { 7685 continue; 7686 } 7687 $term = get_term( $term_id, $taxonomy ); 7688 if ( is_wp_error( $term ) ) { 7689 continue; 7690 } 7691 7692 $term_ids[] = $term_id; 7693 } 7694 } 7695 } 7672 $term_ids = array_unique( $term_ids ); 7696 7673 } 7697 7674
Note: See TracChangeset
for help on using the changeset viewer.