wpseek.com
WordPress开发者和主题制作者的搜索引擎



rest_allowed_cors_headers › WordPress过滤钩子

Since6.3.0
已弃用n/a
› apply_filters( 'rest_allowed_cors_headers', $allow_headers, $request )
参数: (2)
  • () allow_headers The list of request headers to allow.
    Required: Yes
  • () request The request in context.
    Required: Yes
定义在:
文档:

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.




源码

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