wp_cache_reset() - WordPress 函数参考中文文档

返回介绍

wp_cache_reset()

发布于 2017-09-11 字数1565 浏览 845 评论 0

Warning: This function has been deprecated. Use WP_Object_Cache::reset() instead.

wp_cache_reset()

Reset internal cache keys and structures.


描述

If the cache back end uses global blog or site IDs as part of its cache keys, this function instructs the back end to reset those keys and perform any cleanup since blog or site IDs have changed since cache init.

This function is deprecated. Use wp_cache_switch_to_blog() instead of this function when preparing the cache for a blog switch. For clearing the cache during unit tests, consider using wp_cache_init(). wp_cache_init() is not recommended outside of unit tests as the performance penalty for using it is high.


源代码

File: wp-includes/cache.php

function wp_cache_reset() {
	_deprecated_function( __FUNCTION__, '3.5.0' );

	global $wp_object_cache;

	$wp_object_cache->reset();
}

更新日志

Version 描述
3.5.0 WP_Object_Cache::reset()
2.6.0 Introduced.

相关函数

Uses

  • wp-includes/cache.php:
    WP_Object_Cache::reset()
  • wp-includes/functions.php:
    _deprecated_function()

User Contributed Notes

上一篇:wp_cache_replace()

下一篇:wp_cache_set()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!