WP_REST_Server::remove_header() WordPress Method
The WP_REST_Server::remove_header() function allows you to remove a specified HTTP header from the list of headers that the WordPress REST API will return. This can be useful if you want to remove a header that is not needed or not supported by your client.
WP_REST_Server::remove_header( string $key ) #
Removes an HTTP header from the current response.
Parameters
- $key
(string)(Required)Header key.
Source
File: wp-includes/rest-api/class-wp-rest-server.php
public function remove_header( $key ) { header_remove( $key ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.8.0 | Introduced. |