pods_transient_set

Set a cached value.

Description

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

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

Parameters (3)

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.

Usage

  1. if ( !function_exists( 'pods_transient_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. // NOTICE! Understand what this does before running. 
  14. $result = pods_transient_set($key, $value, $expires); 
  15.  

Defined (1)

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

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