Filters the value of an existing site transient before it is retrieved. The dynamic portion of the hook name, `$transient`, refers to the transient name. Returning a value other than boolean false will short-circuit retrieval and return that value instead.
$transient, $value, $expiration = 0
Sortie :
@param mixed $pre_site_transient The default value to return if the site transient does not exist. @param string $transient Transient name. @param mixed $value Value of site transient. @param string $transient Transient name. @param string $transient Transient name. Expected to not be SQL-escaped. Must be @param mixed $value Transient value. Expected to not be SQL-escaped. @param int $expiration Optional. Time until expiration in seconds. Default 0 (no expiration). @return bool True if the value was set, false otherwise.
// Utilisation de la fonction set_site_transient
$result = set_site_transient($transient, $value, $expiration = 0);
if ($result) {
// Votre logique ici
}
Chargement des actualités...