wp_cache_set_multiple() WordPress Function
The wp_cache_set_multiple() function allows you to set multiple values in the WordPress Object Cache at once. This is a useful function when you need to set a large number of values in the cache, as it can help to improve performance by reducing the number of cache reads and writes.
wp_cache_set_multiple( array $data, string $group = '', int $expire ) #
Sets multiple values to the cache in one call.
Description
See also
Parameters
- $data
(array)(Required)Array of keys and values to be set.
- $group
(string)(Optional) Where the cache contents are grouped.
Default value: ''
- $expire
(int)(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 either true on success, or false on failure.
Source
File: wp-includes/cache.php
function wp_cache_set_multiple( array $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->set_multiple( $data, $group, $expire ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
6.0.0 | Introduced. |