On this page
WP_Object_Cache::set_multiple( array $data, string $group = '', int $expire ): bool[]
Sets multiple values to the cache in one call.
Parameters
$dataarray Required-
Array of key and value to be set.
$groupstring Optional-
Where the cache contents are grouped.
Default:
'' $expireint Optional-
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
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;
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Object_Cache::set() wp-includes/class-wp-object-cache.php | Sets the data contents into the cache. |
Used By
| Used By | Description |
|---|---|
| wp_cache_set_multiple() wp-includes/cache.php | Sets multiple values to the cache in one call. |
Changelog
| Version | Description |
|---|---|
| 6.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_object_cache/set_multiple