W3cubDocs

/WordPress

wp_cache_add_multiple( array $data, string $group = , int $expire ): bool[]

Adds multiple values to the cache in one call.

Description

See also

Parameters

$dataarrayrequired
Array of keys and values to be set.
$groupstringoptional
Where the cache contents are grouped.

Default:''

$expireintoptional
When to expire the cache contents, in seconds.
Default 0 (no expiration).

Return

bool[] Array of return values, grouped by key. Each value is either true on success, or false if cache key and group already exist.

Source

function wp_cache_add_multiple( array $data, $group = '', $expire = 0 ) {
	global $wp_object_cache;

	return $wp_object_cache->add_multiple( $data, $group, $expire );
}

Changelog

Version Description
6.0.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_cache_add_multiple