filtrod 4.7.0
rest_pre_update_setting
Opis — z kodu źródłowego
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.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$result | bool | Whether to override the default behavior for updating the value of a setting. |
$name | string | Setting name (as shown in REST API responses). |
$value | mixed | Updated setting value. |
$args | array | Arguments passed to register_setting() for this setting. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_pre_update_setting', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_pre_update_setting', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}Popularne w tej kategorii