wp_cache_get

Retrieves the cache contents from the cache by key and group.

Description

(bool|mixed) wp_cache_get( (int|string) $id, (string) $flag = '' ); 

Returns (bool|mixed)

False on failure to retrieve contents or the cache contents on success

Parameters (2)

0. $id (int|string)
What the contents in the cache are called
1. $flag — Optional. (string) => ''
Where the cache contents are grouped

Usage

  1. if ( !function_exists( 'wp_cache_get' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-object-cache.php'; 
  3.  
  4. // What the contents in the cache are called 
  5. $id = null; 
  6.  
  7. // Where the cache contents are grouped 
  8. $flag = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wp_cache_get($id, $flag); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/backpress/functions.wp-object-cache.php  
  1. function wp_cache_get($id, $flag = '') { 
  2. global $wp_object_cache; 
  3.  
  4. return $wp_object_cache->get($id, $flag);