wp_cache_get

函数
wp_cache_get ( $key, $group = '', $force = false, $found = null )
参数
  • (int|string) $key The key under which the cache contents are stored.
    Required:
  • (string) $group Optional. Where the cache contents are grouped. Default empty.
    Required:
    Default: (empty)
  • (bool) $force Optional. Whether to force an update of the local cache from the persistent cache. Default false.
    Required:
    Default: false
  • (bool) $found Optional. Whether the key was found in the cache (passed by reference). Disambiguates a return of false, a storable value. Default null.
    Required:
    Default: null
返回值
  • (mixed|false) The cache contents on success, false on failure to retrieve contents.
相关
  • WP_Object_Cache::get()
定义位置
相关方法
wp_cache_setwp_cache_resetwp_cache_deletewp_cache_decrwp_cache_init
引入
2.0.0
弃用
-

wp_cache_get: 这个函数从缓存中检索与指定键相关的值。如果在缓存中没有找到该键,该函数返回false。

按键和组从高速缓存中检索高速缓存内容。

function wp_cache_get( $key, $group = '', $force = false, &$found = null ) {
	global $wp_object_cache;

	return $wp_object_cache->get( $key, $group, $force, $found );
}

常见问题

FAQs
查看更多 >