pre_transient_{$transient}

FILTER wp-includes\option.php (ligne 1449) github
Filters the value of an existing transient before it is retrieved. The dynamic portion of the hook name, `$transient`, refers to the transient name. Returning a value other than false from the filter will short-circuit retrieval and return that value instead.

Paramètres

Entrée :
false, $transient
Sortie :
@param mixed  $pre_transient The default value to return if the transient does not exist.
@param string $transient     Transient name.

Utilisation

// Modifier la valeur avec le filtre 'pre_transient_{$transient}'
add_filter('pre_transient_{$transient}', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre(false) {
    // Modifier la valeur
    return false;
}

Actualités

Chargement des actualités...