apply_filters( 'rest_exposed_cors_headers', string[] $expose_headers, WP_REST_Request $request )
- Since
- 5.5.0, 6.3.0
Filters the list of response headers that are exposed to REST API CORS requests.
Compatibility
- WordPress
- since 6.3.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$expose_headersstring[]- The list of response headers to expose.
$requestWP_REST_Request- The request in context.
Where this hook fires · 1
wp-includes/rest-api/class-wp-rest-server.php:412WP_REST_Server::serve_request()
Source code
* @since 5.5.0 * @since 6.3.0 The `$request` parameter was added. * * @param string[] $expose_headers The list of response headers to expose. * @param WP_REST_Request $request The request in context. */ $expose_headers = apply_filters( 'rest_exposed_cors_headers', $expose_headers, $request ); $this->send_header( 'Access-Control-Expose-Headers', implode( ', ', $expose_headers ) ); $allow_headers = array( 'Authorization', 'X-WP-Nonce',Changelog
Introduced in 5.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
6.3.0
The
$request parameter was added.from the docblock5.5.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.