WordPress开发者和主题制作者的搜索引擎



wp_cache_replace ›

Since2.0.0
已弃用n/a
wp_cache_replace ( $key, $data, $group = '', $expire = 0 )
参数: (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
    默认: (empty)
  • (int) $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration).
    Required: No
    默认:
查看:
  • WP_Object_Cache::replace()
返回:
  • (bool) False if original value does not exist, true if contents were replaced
定义在:
文档:

Replaces the contents of the cache with new data.



源码

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

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