pre_option

FILTER wp-includes\option.php (ligne 150) github
Filters the value of any existing option before it is retrieved. Returning a value other than false from the filter will short-circuit retrieval and return that value instead.

Paramètres

Entrée :
$pre, $option, $default_value
Sortie :
@param mixed  $pre_option    The value to return instead of the option value. This differs from
@param string $option        Name of the option.
@param mixed  $default_value The fallback value to return if the option does not exist.

Utilisation

// Modifier la valeur avec le filtre 'pre_option'
add_filter('pre_option', 'ma_fonction_filtre', 10, 1);

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

Actualités

Chargement des actualités...