pods_view_get

Get a cached value.

Description

(bool|mixed|null|void) pods_view_get( (string) $key, (string) $cache_mode = 'cache', (string) $group = '', (null) $callback = null ); 

Returns (bool|mixed|null|void)

Parameters (4)

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

Usage

  1. if ( !function_exists( 'pods_view_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) Decides the caching method to use for the view. 
  8. $cache_mode = 'cache'; 
  9.  
  10. // (optional) Key for the group 
  11. $group = ''; 
  12.  
  13. // (optional) Callback function to run to set the value if not cached 
  14. $callback = null; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = pods_view_get($key, $cache_mode, $group, $callback); 
  18.  

Defined (1)

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

/includes/general.php  
  1. function pods_view_get ( $key, $cache_mode = 'cache', $group = '', $callback = null ) { 
  2. require_once( PODS_DIR . 'classes/PodsView.php' ); 
  3.  
  4. return PodsView::get( $key, $cache_mode, $group, $callback );