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.


Top ↑

Source

File: wp-includes/rest-api/class-wp-rest-server.php

	public function remove_header( $key ) {
		header_remove( $key );
	}


Top ↑

Changelog

Changelog
VersionDescription
4.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.