rest_pre_update_setting

FILTER wp-includes\rest-api\endpoints\class-wp-rest-settings-controller.php (ligne 169) github
Filters whether to preempt a setting value update via the REST API. Allows hijacking the setting update logic and overriding the built-in behavior by returning true.

Paramètres

Entrée :
false, $name, $request[ $name ], $args
Sortie :
@param bool   $result Whether to override the default behavior for updating the
@param string $name   Setting name (as shown in REST API responses).
@param mixed  $value  Updated setting value.
@param array  $args   Arguments passed to register_setting() for this setting.

Utilisation

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

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

Actualités

Chargement des actualités...