Retrieves cached data if valid and unchanged.
Parameters
$cache_keystringrequired- The cache key used for storage and retrieval.
$groupstringrequired- The cache group used for organizing data.
$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_salted( $cache_key, $group, $salt ) {
$salt = is_array( $salt ) ? implode( ':', $salt ) : $salt;
$cache = wp_cache_get( $cache_key, $group );
if ( ! is_array( $cache ) ) {
return false;
}
if ( ! isset( $cache['salt'] ) || ! isset( $cache['data'] ) || $salt !== $cache['salt'] ) {
return false;
}
return $cache['data'];
}
Changelog
| Version | Description |
|---|---|
| 6.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.