wp_cache_reset

Reset internal cache keys and structures.

Description

wp_cache_reset(); 

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.


Usage

  1. if ( !function_exists( 'wp_cache_reset' ) ) { 
  2. require_once ABSPATH . WPINC . '/cache.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_cache_reset(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/cache.php  
  1. function wp_cache_reset() { 
  2. _deprecated_function( __FUNCTION__, '3.5.0' ); 
  3.  
  4. global $wp_object_cache; 
  5.  
  6. $wp_object_cache->reset();