Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_transient [ WordPress Function ]

get_transient ( $transient )
Parameters:
  • (string) $transient Transient name. Expected to not be SQL-escaped
Uses:
Returns:
  • (mixed) Value of transient
Defined at:



Get the value of a transient.

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

Source


<?php
function get_transient$transient ) {
    global 
$_wp_using_ext_object_cache;

    
$pre apply_filters'pre_transient_' $transientfalse );
    if ( 
false !== $pre )
        return 
$pre;

    if ( 
$_wp_using_ext_object_cache ) {
        
$value wp_cache_get$transient'transient' );
    } else {
        
$transient_option '_transient_' $transient;
        if ( ! 
defined'WP_INSTALLING' ) ) {
            
// If option is not in alloptions, it is not autoloaded and thus has a timeout
            
$alloptions wp_load_alloptions();
            if ( !isset( 
$alloptions[$transient_option] ) ) {
                
$transient_timeout '_transient_timeout_' $transient;
                if ( 
get_option$transient_timeout ) < time() ) {
                    
delete_option$transient_option  );
                    
delete_option$transient_timeout );
                    return 
false;
                }
            }
        }

        
$value get_option$transient_option );
    }

    return 
apply_filters'transient_' $transient$value );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics