Switch language

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




get_site_transient [ WordPress Function ]

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



Get the value of a site transient.

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

Source


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

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

    if ( 
$_wp_using_ext_object_cache ) {
        
$value wp_cache_get$transient'site-transient' );
    } else {
        
// Core transients that do not have a timeout. Listed here so querying timeouts can be avoided.
        
$no_timeout = array('update_core''update_plugins''update_themes');
        
$transient_option '_site_transient_' $transient;
        if ( ! 
in_array$transient$no_timeout ) ) {
            
$transient_timeout '_site_transient_timeout_' $transient;
            
$timeout get_site_option$transient_timeout );
            if ( 
false !== $timeout && $timeout time() ) {
                
delete_site_option$transient_option  );
                
delete_site_option$transient_timeout );
                return 
false;
            }
        }

        
$value get_site_option$transient_option );
    }

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

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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