WP_Object_Cache::get_multiple() – Method | Developer.WordPress.org

Retrieves multiple values from the cache in one call.

Parameters

$keysarrayrequired

Array of keys under which the cache contents are stored.

$groupstringoptional

Where the cache contents are grouped. Default 'default'.

$forcebooloptional

Whether to force an update of the local cache from the persistent cache.

Default:false

Return

array Array of return values, grouped by key. Each value is either the cache contents on success, or false on failure.

Source

public function get_multiple( $keys, $group = 'default', $force = false ) {
	$values = array();

	foreach ( $keys as $key ) {
		$values[ $key ] = $this->get( $key, $group, $force );
	}

	return $values;
}

View all references View on Trac View on GitHub

Changelog

VersionDescription
5.5.0Introduced.