Changeset 48065 for trunk/src/wp-includes/taxonomy.php
- Timestamp:
- 06/16/2020 07:07:04 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r48055 r48065 3269 3269 $terms = $wpdb->get_results( "SELECT term_id, taxonomy FROM $wpdb->term_taxonomy WHERE term_taxonomy_id IN ($tt_ids)" ); 3270 3270 $ids = array(); 3271 3271 3272 foreach ( (array) $terms as $term ) { 3272 3273 $taxonomies[] = $term->taxonomy; … … 3274 3275 wp_cache_delete( $term->term_id, 'terms' ); 3275 3276 } 3277 3276 3278 $taxonomies = array_unique( $taxonomies ); 3277 3279 } else { 3278 3280 $taxonomies = array( $taxonomy ); 3281 3279 3282 foreach ( $taxonomies as $taxonomy ) { 3280 3283 foreach ( $ids as $id ) { … … 3406 3409 } 3407 3410 3408 $object_ids = array_map( 'intval', $object_ids ); 3411 $object_ids = array_map( 'intval', $object_ids ); 3412 $non_cached_ids = array(); 3409 3413 3410 3414 $taxonomies = get_object_taxonomies( $object_type ); 3411 3415 3412 $ids = array();3413 3416 foreach ( $taxonomies as $taxonomy ) { 3414 3417 $cache_values = wp_cache_get_multiple( (array) $object_ids, "{$taxonomy}_relationships" ); 3415 foreach ( $cache_values as $key => $value ) { 3418 3419 foreach ( $cache_values as $id => $value ) { 3416 3420 if ( false === $value ) { 3417 $ ids[] = $key;3421 $non_cached_ids[] = $id; 3418 3422 break; 3419 3423 } … … 3421 3425 } 3422 3426 3423 if ( empty( $ ids ) ) {3427 if ( empty( $non_cached_ids ) ) { 3424 3428 return false; 3425 3429 } 3426 3430 3427 3431 $terms = wp_get_object_terms( 3428 $ ids,3432 $non_cached_ids, 3429 3433 $taxonomies, 3430 3434 array( … … 3440 3444 } 3441 3445 3442 foreach ( $ ids as $id ) {3446 foreach ( $non_cached_ids as $id ) { 3443 3447 foreach ( $taxonomies as $taxonomy ) { 3444 3448 if ( ! isset( $object_terms[ $id ][ $taxonomy ] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.