wp_cache_add_multiple()WP 6.0.0

Adds multiple values to the cache in one call, if the cache keys don't already exist.

Compat function to mimic wp_cache_add_multiple().

Хуков нет.


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


wp_cache_add_multiple( $data, $group, $expire );
$data(массив) (обязательный)
Array of keys and values to be added.
Where the cache contents are grouped.
По умолчанию: ''
When to expire the cache contents, in seconds.
По умолчанию: 0 (no expiration)


Список изменений

С версии 6.0.0 Введена.

Код wp_cache_add_multiple() WP 6.0.2

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

	foreach ( $data as $key => $value ) {
		$values[ $key ] = wp_cache_add( $key, $value, $group, $expire );

	return $values;