bb_get_transient

Get the value of a transient.

Description

bb_get_transient( (string) $transient ); 

If the transient does not exist or does not have a value, then the return value will be false.

Parameters (1)

0. $transient (string)
Transient name. Expected to not be SQL-escaped

Usage

  1. if ( !function_exists( 'bb_get_transient' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-meta.php'; 
  3.  
  4. // Transient name. Expected to not be SQL-escaped 
  5. $transient = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_get_transient($transient); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-meta.php  
  1. function bb_get_transient( $transient ) 
  2. global $_bb_using_ext_object_cache, $bbdb; 
  3.  
  4. if ( $_bb_using_ext_object_cache ) { 
  5. $value = wp_cache_get( $transient, 'transient' ); 
  6. } else { 
  7. $transient_option = '_transient_' . $bbdb->escape( $transient ); 
  8. $transient_timeout = '_transient_timeout_' . $bbdb->escape( $transient ); 
  9. $timeout = bb_get_option( $transient_timeout ); 
  10. if ( $timeout && $timeout < time() ) { 
  11. bb_delete_option( $transient_option ); 
  12. bb_delete_option( $transient_timeout ); 
  13. return false; 
  14.  
  15. $value = bb_get_option( $transient_option ); 
  16.