Retrieves multiple items from the cache, only considering valid and unchanged items.
Parameters
$cache_keysarrayrequired- Array of cache keys to retrieve.
$groupstringrequired- The group of the cache to check.
$saltstring|string[]required- The timestamp (or multiple timestamps if an array) indicating when the cache group(s) were last updated.
Source
function wp_cache_get_multiple_salted( $cache_keys, $group, $salt ) {
$salt = is_array( $salt ) ? implode( ':', $salt ) : $salt;
$cache = wp_cache_get_multiple( $cache_keys, $group );
foreach ( $cache as $key => $value ) {
if ( ! is_array( $value ) ) {
$cache[ $key ] = false;
continue;
}
if ( ! isset( $value['salt'], $value['data'] ) || $salt !== $value['salt'] ) {
$cache[ $key ] = false;
continue;
}
$cache[ $key ] = $value['data'];
}
return $cache;
}
Changelog
| Version | Description |
|---|---|
| 6.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.