WP HOOKS
filtrod 4.4.0

rest_request_parameter_order

Args 2Plik wp-includes/rest-api/class-wp-rest-request.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the parameter priority order for a REST API request.

The order affects which parameters are checked when using WP_REST_Request::get_param() and family. This acts similarly to PHP's request_order setting.

Parametry

ParametrTypOpis
$orderstring[]Array of types to check, in order of priority.
$request\WP_REST_RequestThe request object.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_request_parameter_order', 'twoja_funkcja', 10, 2 );

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

Popularne w tej kategorii