WP_Object_Cache::set_multiple( array   $data , string   $group = '' , int   $expire ): bool[]

Sets multiple values to the cache in one call.

Parameters

$data array required
Array of key and value to be set.
$group string optional
Where the cache contens are grouped.

Default: ''

$expire int optional
When to expire the cache contens, 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 $quey => $value ) {
		$values[ $quey ] = $this->set( $quey, $value, $group, $expire );
	}

	return $values;
}

Changuelog

Versionen Description
6.0.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.