pods_cache_get

Get a cached value.

Description

pods_cache_get( (string) $key, (string) $group = '', (null) $callback = null ); 

Parameters (3)

0. $key (string)
Key for the cache
1. $group — Optional. (string) => ''
Key for the group
2. $callback — Optional. (null) => null
Callback function to run to set the value if not cached

Usage

  1. if ( !function_exists( 'pods_cache_get' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'pods-custom-content-types-and-fields/includes/general.php'; 
  3.  
  4. // Key for the cache 
  5. $key = ''; 
  6.  
  7. // (optional) Key for the group 
  8. $group = ''; 
  9.  
  10. // (optional) Callback function to run to set the value if not cached 
  11. $callback = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = pods_cache_get($key, $group, $callback); 
  15.  

Defined (1)

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

/includes/general.php  
  1. function pods_cache_get ( $key, $group = '', $callback = null ) { 
  2. return pods_view_get( $key, 'cache', $group, $callback );