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

Sets multiple values to the cache in one call.


$data array Required
Array of key and value to be set.
$group string Optional
Where the cache contents are grouped.

Default: ''

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

Top ↑


bool[] Array of return values, grouped by key. Each value is always true.

Top ↑


File: wp-includes/class-wp-object-cache.php. View all references

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;

Top ↑


Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes

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