WP HOOKS
filtrod 5.5.0

rest_exposed_cors_headers

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

Opis — z kodu źródłowego

Filters the list of response headers that are exposed to REST API CORS requests.

Parametry

ParametrTypOpis
$expose_headersstring[]The list of response headers to expose.
$request\WP_REST_RequestThe request in context.

Wywołanie

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

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

Popularne w tej kategorii