Codex tools: Log in
Contents |
Set/update the value of a transient.
You do not need to serialize values. If the value needs to be serialized, then it will be serialized before it is set.
<?php set_transient( $transient, $value, $expiration ); ?>
<?php set_transient( 'special_query_results', $special_query_results, 60*60*12 ); ?>
If a transient exists, this function will update the transient's expiration time.
NB: transients that never expire are autoloaded, whereas transients with an expiration time are not autoloaded. Consider this when adding transients that may not be needed on every page, and thus do not need to be autoloaded, impacting page performance.
Since: 2.8
set_transient() is located in wp-includes/option.php.
Transients API: set_transient(), get_transient(), delete_transient(), set_site_transient(), get_site_transient(), delete_site_transient()