Changeset 48065
- Timestamp:
- 06/16/2020 07:07:04 PM (5 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r48059 r48065 6360 6360 */ 6361 6361 function _get_non_cached_ids( $object_ids, $cache_key ) { 6362 $ clean= array();6363 $cache_values = wp_cache_get_multiple( $object_ids, $cache_key );6364 foreach ( $cache_values as $id => $cache_value ) { 6365 $id = (int) $id;6366 if ( ! $ cache_value ) {6367 $ clean[] =$id;6368 } 6369 } 6370 6371 return $ clean;6362 $non_cached_ids = array(); 6363 $cache_values = wp_cache_get_multiple( $object_ids, $cache_key ); 6364 6365 foreach ( $cache_values as $id => $value ) { 6366 if ( ! $value ) { 6367 $non_cached_ids[] = (int) $id; 6368 } 6369 } 6370 6371 return $non_cached_ids; 6372 6372 } 6373 6373 -
trunk/src/wp-includes/meta.php
r48055 r48065 927 927 } 928 928 929 $cache_key = $meta_type . '_meta'; 930 $ids = array(); 931 $cache = array(); 932 $cache_values = wp_cache_get_multiple( $object_ids, $cache_key ); 929 $cache_key = $meta_type . '_meta'; 930 $non_cached_ids = array(); 931 $cache = array(); 932 $cache_values = wp_cache_get_multiple( $object_ids, $cache_key ); 933 933 934 foreach ( $cache_values as $id => $cached_object ) { 934 935 if ( false === $cached_object ) { 935 $ ids[] = $id;936 $non_cached_ids[] = $id; 936 937 } else { 937 938 $cache[ $id ] = $cached_object; … … 939 940 } 940 941 941 if ( empty( $ ids ) ) {942 if ( empty( $non_cached_ids ) ) { 942 943 return $cache; 943 944 } 944 945 945 946 // Get meta info. 946 $id_list = join( ',', $ ids );947 $id_list = join( ',', $non_cached_ids ); 947 948 $id_column = ( 'user' === $meta_type ) ? 'umeta_id' : 'meta_id'; 948 949 … … 968 969 } 969 970 970 foreach ( $ ids as $id ) {971 foreach ( $non_cached_ids as $id ) { 971 972 if ( ! isset( $cache[ $id ] ) ) { 972 973 $cache[ $id ] = array(); -
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.