Make WordPress Core


Ignore:
Timestamp:
06/16/2020 06:28:57 AM (6 years ago)
Author:
whyisjake
Message:

Cache API: Add wp_cache_get_multiple() to core functions.

  • update_object_term_cache
  • update_meta_cache
  • _get_non_cached_ids

See [47938].

Fixes #50352.

Props spacedmonkey, tillkruss, lukecavanagh.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r47930 r48055  
    34113411
    34123412    $ids = array();
    3413     foreach ( (array) $object_ids as $id ) {
    3414         foreach ( $taxonomies as $taxonomy ) {
    3415             if ( false === wp_cache_get( $id, "{$taxonomy}_relationships" ) ) {
    3416                 $ids[] = $id;
     3413    foreach ( $taxonomies as $taxonomy ) {
     3414        $cache_values = wp_cache_get_multiple( (array) $object_ids, "{$taxonomy}_relationships" );
     3415        foreach ( $cache_values as $key => $value ) {
     3416            if ( false === $value ) {
     3417                $ids[] = $key;
    34173418                break;
    34183419            }
Note: See TracChangeset for help on using the changeset viewer.