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

Sets multiple values to the cache in one call.

Parameters

$dataarrayrequired

Array of key and value to be set.

$groupstringoptional

Where the cache contents are grouped. Default empty.

$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 always true.

Source

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

	foreach ( $data as $key => $value ) {
		$values[ $key ] = $this->set( $key, $value, $group, $expire );
	}

	return $values;
}

View all references View on Trac View on GitHub

Changelog

VersionDescription
6.0.0Introduced.