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

wp_cache_reset() WordPress Function

The wp_cache_reset() function is used to clear the cache for a given WordPress object type. The function takes a single parameter, which is the name of the object type.

wp_cache_reset() #

Resets internal cache keys and structures.


Description

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.

Top ↑

See also


Top ↑

Source

File: wp-includes/cache.php

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

	global $wp_object_cache;

	$wp_object_cache->reset();
}


Top ↑

Changelog

Changelog
VersionDescription
3.5.0Use wp_cache_switch_to_blog()
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.