pods_cache_set

Set a cached value.

Description

(bool|mixed|null|string|void) pods_cache_set( (string) $key, (mixed) $value, (string) $group = '', (int) $expires = 0 ); 

Returns (bool|mixed|null|string|void)

Parameters (4)

0. $key (string)
Key for the cache
1. $value (mixed)
Value to add to the cache
2. $group — Optional. (string) => ''
Key for the group
3. $expires — Optional. (int)
Time in seconds for the cache to expire, if 0 no expiration.

Usage

  1. if ( !function_exists( 'pods_cache_set' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'pods-custom-content-types-and-fields/includes/general.php'; 
  3.  
  4. // Key for the cache 
  5. $key = ''; 
  6.  
  7. // Value to add to the cache 
  8. $value = null; 
  9.  
  10. // (optional) Key for the group 
  11. $group = ''; 
  12.  
  13. // (optional) Time in seconds for the cache to expire, if 0 no expiration. 
  14. $expires = -1; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = pods_cache_set($key, $value, $group, $expires); 
  18.  

Defined (1)

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

/includes/general.php  
  1. function pods_cache_set ( $key, $value, $group = '', $expires = 0) { 
  2. return pods_view_set( $key, $value, $expires, 'cache', $group );