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
查看更多 >
闪电伯伯

(工作日 10:00 - 18:30 为您服务)

2025-11-18 00:27:15

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: