filtrod 5.5.0
rest_exposed_cors_headers
Opis — z kodu źródłowego
Filters the list of response headers that are exposed to REST API CORS requests.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$expose_headers | string[] | The list of response headers to expose. |
$request | \WP_REST_Request | The 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
}
// 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