wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_cache_replace › WordPress Function

Since2.0.0
Deprecatedn/a
wp_cache_replace ( $key, $data, $group = '', $expire = 0 )
Parameters: (4)
  • (int|string) $key The key for the cache data that should be replaced.
    Required: Yes
  • (mixed) $data The new data to store in the cache.
    Required: Yes
  • (string) $group Optional. The group for the cache data that should be replaced. Default empty.
    Required: No
    Default: (empty)
  • (int) $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration).
    Required: No
    Default:
See:
  • WP_Object_Cache::replace()
Returns:
  • (bool) True if contents were replaced, false if original value does not exist.
Defined at:
Codex:

Replaces the contents of the cache with new data.



Source

function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) {
	global $wp_object_cache;

	return $wp_object_cache->replace( $key, $data, $group, (int) $expire );
}