wp_cache_delete

Removes the cache contents matching key and group.

Description

wp_cache_delete( (int|string) $key, (string) $group = '' ); 

Parameters (2)

0. $key (int|string)
What the contents in the cache are called.
1. $group — Optional. (string) => ''
Where the cache contents are grouped. Default empty.

Usage

  1. if ( !function_exists( 'wp_cache_delete' ) ) { 
  2. require_once ABSPATH . WPINC . '/cache.php'; 
  3.  
  4. // What the contents in the cache are called. 
  5. $key = null; 
  6.  
  7. // Optional. Where the cache contents are grouped. Default empty. 
  8. $group = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wp_cache_delete($key, $group); 
  12.  

Defined (1)

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

/wp-includes/cache.php  
  1. function wp_cache_delete( $key, $group = '' ) { 
  2. global $wp_object_cache; 
  3.  
  4. return $wp_object_cache->delete($key, $group);