Switch language

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




set_site_transient [ WordPress Function ]

set_site_transient ( $transient, $value, $expiration = 0 )
Parameters:
  • (string) $transient Transient name. Expected to not be SQL-escaped.
  • (mixed) $value Transient value. Expected to not be SQL-escaped.
  • (int) $expiration Time until expiration in seconds, default 0
Uses:
See:
Returns:
  • (bool) False if value was not set and true if value was set.
Defined at:



Set/update the value of a site transient.

You do not need to serialize values, if the value needs to be serialize, then it will be serialized before it is set.

Source


<?php
function set_site_transient$transient$value$expiration ) {
    global 
$_wp_using_ext_object_cache;

    
$value apply_filters'pre_set_site_transient_' $transient$value );

    if ( 
$_wp_using_ext_object_cache ) {
        
$result wp_cache_set$transient$value'site-transient'$expiration );
    } else {
        
$transient_timeout '_site_transient_timeout_' $transient;
        
$transient '_site_transient_' $transient;
        if ( 
false === get_site_option$transient ) ) {
            if ( 
$expiration )
                
add_site_option$transient_timeouttime() + $expiration );
            
$result add_site_option$transient$value );
        } else {
            if ( 
$expiration )
                
update_site_option$transient_timeouttime() + $expiration );
            
$result update_site_option$transient$value );
        }
    }
    if ( 
$result ) {
        
do_action'set_site_transient_' $transient );
        
do_action'setted_site_transient'$transient );
    }
    return 
$result;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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