Make WordPress Core

Ticket #20875: 20875-_get_non_cached_ids.diff

File 20875-_get_non_cached_ids.diff, 1.0 KB (added by spacedmonkey, 8 years ago)
  • src/wp-includes/functions.php

     
    54095409 * @access private
    54105410 *
    54115411 * @param array  $object_ids ID list.
    5412  * @param string $cache_key  The cache bucket to check against.
     5412 * @param string $group  The cache bucket to check against.
    54135413 *
    54145414 * @return array List of ids not present in the cache.
    54155415 */
    5416 function _get_non_cached_ids( $object_ids, $cache_key ) {
    5417         $clean = array();
    5418         foreach ( $object_ids as $id ) {
    5419                 $id = (int) $id;
    5420                 if ( ! wp_cache_get( $id, $cache_key ) ) {
    5421                         $clean[] = $id;
     5416function _get_non_cached_ids( $object_ids, $group ) {
     5417        $clean        = array();
     5418        $object_ids   = array_map( $object_ids, 'intval' );
     5419        $groups       = array( $group => $object_ids );
     5420        $cache_result = wp_cache_get_multiple( $groups );
     5421
     5422        foreach ( $cache_result as $key => $value ) {
     5423                if ( false === $value ) {
     5424                        $clean[] = $key;
    54225425                }
    54235426        }
    54245427