Replaces the contents of the cache with new data.
Description
See also
Parameters
$key
int|stringrequired- The key for the cache data that should be replaced.
$data
mixedrequired- The new data to store in the cache.
$group
stringoptional- The group for the cache data that should be replaced.
Default:
''
$expire
intoptional- When to expire the cache contents, in seconds.
Default 0 (no expiration).
Source
function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) {
global $wp_object_cache;
return $wp_object_cache->replace( $key, $data, $group, (int) $expire );
}
Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.