wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



rest_allowed_cors_headers › Hooks de Filtros WordPress

Desde6.3.0
Obsoleton/a
› apply_filters( 'rest_allowed_cors_headers', $allow_headers, $request )
Parâmetros: (2)
  • () allow_headers The list of request headers to allow.
    Required: Yes
  • () request The request in context.
    Required: Yes
Definido em:
Codex:

Filters the list of request headers that are allowed for REST API 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.




Fonte

$allow_headers = apply_filters( 'rest_allowed_cors_headers', $allow_headers, $request );