wp_cache_replace

函式
wp_cache_replace ( $key, $data, $group = '', $expire = 0 )
引數
  • (int|string) $key The key for the cache data that should be replaced.
    Required:
  • (mixed) $data The new data to store in the cache.
    Required:
  • (string) $group Optional. The group for the cache data that should be replaced. Default empty.
    Required:
    Default: (empty)
  • (int) $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration).
    Required:
返回值
  • (bool) True if contents were replaced, false if original value does not exist.
相關
  • WP_Object_Cache::replace()
定義位置
相關方法
wp_cache_resetwp_cache_deletewp_cache_decrwp_cache_closewp_cache_set
引入
2.0.0
棄用
-

wp_cache_replace函式用新的資料替換一個快取項的內容。

用新的資料替換快取的內容。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) {
global $wp_object_cache;
return $wp_object_cache->replace( $key, $data, $group, (int) $expire );
}
function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->replace( $key, $data, $group, (int) $expire ); }
function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) {
	global $wp_object_cache;

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

常見問題

FAQs
檢視更多 >