set_transient_{$transient}

ACTION wp-includes\option.php (ligne 1594) github
Fires after the value for a specific transient has been set. The dynamic portion of the hook name, `$transient`, refers to the transient name.

Paramètres

Entrée :
$value, $expiration, $transient
Sortie :
@param mixed  $value      Transient value.
@param int    $expiration Time until expiration in seconds.
@param string $transient  The name of the transient.

Utilisation

// Ajouter une fonction au hook action 'set_transient_{$transient}'
add_action('set_transient_{$transient}', 'ma_fonction_personnalisee', 10, 1);

function ma_fonction_personnalisee($value, $expiration, $transient) {
    // Votre code ici
    error_log('Hook set_transient_{$transient} déclenché');
}

Actualités

Chargement des actualités...