2020-06-09 21:50:09 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Object Cache API functions missing from 3rd party object caches.
|
|
|
|
*
|
|
|
|
* @link https://codex.wordpress.org/Class_Reference/WP_Object_Cache
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Cache
|
|
|
|
*/
|
|
|
|
|
|
|
|
if ( ! function_exists( 'wp_cache_get_multiple' ) ) :
|
|
|
|
/**
|
2020-06-10 11:57:09 +02:00
|
|
|
* Retrieves multiple values from the cache in one call.
|
|
|
|
*
|
|
|
|
* Compat function to mimic wp_cache_get_multiple().
|
2020-06-09 21:50:09 +02:00
|
|
|
*
|
|
|
|
* @ignore
|
|
|
|
* @since 5.5.0
|
|
|
|
*
|
|
|
|
* @see wp_cache_get_multiple()
|
|
|
|
*
|
2020-06-10 11:57:09 +02:00
|
|
|
* @param array $keys Array of keys under which the cache contents are stored.
|
|
|
|
* @param string $group Optional. Where the cache contents are grouped. Default empty.
|
|
|
|
* @param bool $force Optional. Whether to force an update of the local cache
|
|
|
|
* from the persistent cache. Default false.
|
2020-06-09 21:50:09 +02:00
|
|
|
* @return array Array of values organized into groups.
|
|
|
|
*/
|
2020-06-10 11:57:09 +02:00
|
|
|
function wp_cache_get_multiple( $keys, $group = '', $force = false ) {
|
2020-06-09 21:50:09 +02:00
|
|
|
$values = array();
|
|
|
|
|
|
|
|
foreach ( $keys as $key ) {
|
|
|
|
$values[ $key ] = wp_cache_get( $key, $group, $force );
|
|
|
|
}
|
|
|
|
|
|
|
|
return $values;
|
|
|
|
}
|
|
|
|
endif;
|