WP HOOKS
filtrod 4.7.0

rest_pre_update_setting

Args 4Plik wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.phpDokumentacja WP ↗

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

ParametrTypOpis
$resultboolWhether to override the default behavior for updating the value of a setting.
$namestringSetting name (as shown in REST API responses).
$valuemixedUpdated setting value.
$argsarrayArguments 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
}

Popularne w tej kategorii