Stores multiple pieces of salted data in the cache.
Parameters
$datamixedrequired- Data to be stored in the cache for all keys.
$groupstringrequired- Group to which the cached data belongs.
$saltstring|string[]required- The timestamp (or multiple timestamps if an array) indicating when the cache group(s) were last updated.
$expireintoptional- When to expire the cache contents, in seconds.
Default 0 (no expiration).
Source
function wp_cache_set_multiple_salted( $data, $group, $salt, $expire = 0 ) {
$salt = is_array( $salt ) ? implode( ':', $salt ) : $salt;
$new_cache = array();
foreach ( $data as $key => $value ) {
$new_cache[ $key ] = array(
'data' => $value,
'salt' => $salt,
);
}
return wp_cache_set_multiple( $new_cache, $group, $expire );
}
Changelog
| Version | Description |
|---|---|
| 6.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.