mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-24 10:09:47 +01:00
1d95eb63a7
Synchronize documentation between `wp_cache_get_multiple()`, its compat version, and the class method. See #20875. Built from https://develop.svn.wordpress.org/trunk@47944 git-svn-id: http://core.svn.wordpress.org/trunk@47717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
38 lines
1.0 KiB
PHP
38 lines
1.0 KiB
PHP
<?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' ) ) :
|
|
/**
|
|
* Retrieves multiple values from the cache in one call.
|
|
*
|
|
* Compat function to mimic wp_cache_get_multiple().
|
|
*
|
|
* @ignore
|
|
* @since 5.5.0
|
|
*
|
|
* @see wp_cache_get_multiple()
|
|
*
|
|
* @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.
|
|
* @return array Array of values organized into groups.
|
|
*/
|
|
function wp_cache_get_multiple( $keys, $group = '', $force = false ) {
|
|
$values = array();
|
|
|
|
foreach ( $keys as $key ) {
|
|
$values[ $key ] = wp_cache_get( $key, $group, $force );
|
|
}
|
|
|
|
return $values;
|
|
}
|
|
endif;
|