get_transient [ WordPress Function ]
get_transient ( $transient )
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: set_transient, get_site_transient, delete_transient, set_site_transient, get_manifest
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_' . $transient, false );
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
- Function Reference/get transient « WordPress Codex
Description. 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.
codex.wordpress.org - Transients API « WordPress Codex
To get a saved transient you use get_transient() : get_transient( ... If the transient does not exist, or has expired, then get_transient will return false. This should ...
codex.wordpress.org - get_transient (WordPress Function) - WPSeek.com
WordPress lookup for get_transient, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - get_transient
Mar 29, 2012 ... Exceptions and errors happen, there is nothing you can do about it if your building sites. Since they are going to happen let's make sure that we ...
wpthemetutorial.com