WordPress at a glance
filter is not described

rest_allowed_cors_headers filter-hook . WP 5.5.0

Filters the list of request headers that are allowed for CORS requests.

The allowed headers are passed to the browser to specify which headers can be passed to the REST API. By default, we allow the Content-* headers needed to upload files to the media endpoints. As well as the Authorization and Nonce headers for allowing authentication.


add_filter( 'rest_allowed_cors_headers', 'filter_function_name_2483' );
function filter_function_name_2483( $allow_headers ){
	// filter...

	return $allow_headers;
The list of headers to allow.

Список изменений

С версии 5.5.0 Введена.

Где вызывается хук

wp-includes/rest-api/class-wp-rest-server.php 279
$allow_headers = apply_filters( 'rest_allowed_cors_headers', $allow_headers );

Где используется хук в ядре WP

Использование не найдено.