CoreFiles by mySites.guru
cache-compat.php37 lines, 1,046 bytes, from wordpress-5.5.2.zip
Raw History Compare with 5.5.1
md5
b83f8f49715fb9eab0501df724d3841f
sha1
55b89850f9a05498f8ccb69a1a9f2eeb43230237
sha256
aae0ebfb1c3aa7aa40b7a615ab94492d52d280c2363abec5e04244a2c973bac2
<?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;

The same content is in 159 releases, WordPress 5.5-beta1 to 5.9.20. See them all, or every version of this file.