WP HOOKS
filtrdynamicznyod 4.6.0

customize_validate_{$this->id}

Args 3Plik wp-includes/class-wp-customize-setting.php

Opis — z kodu źródłowego

Validates a Customize setting value.

Plugins should amend the $validity object via its WP_Error::add() method. The dynamic portion of the hook name, $this->ID, refers to the setting ID.

Parametry

ParametrTypOpis
$validity\WP_ErrorFiltered from <code>true</code> to <code>WP_Error</code> when invalid.
$valuemixedValue of the setting.
$setting\WP_Customize_SettingWP_Customize_Setting instance.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'customize_validate_{$this->id}', 'twoja_funkcja', 10, 3 );

function twoja_funkcja($param_1, $param_2, $param_3) {
	// Twój kod
}

Popularne w tej kategorii