pods_transient_get

Get a cached value.

Description

(bool|mixed|null|void) pods_transient_get( (string) $key, (null) $callback = null ); 

Returns (bool|mixed|null|void)

Parameters (2)

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

Usage

  1. if ( !function_exists( 'pods_transient_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) Callback function to run to set the value if not cached 
  8. $callback = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = pods_transient_get($key, $callback); 
  12.  

Defined (1)

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

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