pods_view_set

Set a cached value.

Description

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

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

Parameters (5)

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

Usage

  1. if ( !function_exists( 'pods_view_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) Time in seconds for the cache to expire, if 0 no expiration. 
  11. $expires = -1; 
  12.  
  13. // (optional) Decides the caching method to use for the view. 
  14. $cache_mode = 'cache'; 
  15.  
  16. // (optional) Key for the group 
  17. $group = ''; 
  18.  
  19. // NOTICE! Understand what this does before running. 
  20. $result = pods_view_set($key, $value, $expires, $cache_mode, $group); 
  21.  

Defined (1)

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

/includes/general.php  
  1. function pods_view_set ( $key, $value, $expires = 0, $cache_mode = 'cache', $group = '' ) { 
  2. require_once( PODS_DIR . 'classes/PodsView.php' ); 
  3.  
  4. return PodsView::set( $key, $value, $expires, $cache_mode, $group );