WP HOOKS
filtrod 6.1.0

rest_json_encode_options

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

Opis — z kodu źródłowego

Filters the JSON encoding options used to send the REST API response.

Parametry

ParametrTypOpis
$optionsintJSON encoding options {@see \json_encode()}.
$request\WP_REST_RequestCurrent request object.

Wywołanie

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

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

Popularne w tej kategorii