WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/16/2020 06:28:57 AM (18 months 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/meta.php

    r47808 r48055  
    927927    }
    928928
    929     $cache_key = $meta_type . '_meta';
    930     $ids       = array();
    931     $cache     = array();
    932     foreach ( $object_ids as $id ) {
    933         $cached_object = wp_cache_get( $id, $cache_key );
     929    $cache_key    = $meta_type . '_meta';
     930    $ids          = array();
     931    $cache        = array();
     932    $cache_values = wp_cache_get_multiple( $object_ids, $cache_key );
     933    foreach ( $cache_values as $id => $cached_object ) {
    934934        if ( false === $cached_object ) {
    935935            $ids[] = $id;
Note: See TracChangeset for help on using the changeset viewer.