WP_HTTP_Response::set_headers() WordPress Method

The set_headers() method of the WP_HTTP_Response class sets the headers for the HTTP response. The headers are an associative array of header names and values. The header names are case-insensitive. This method can be called before or after the body of the response has been set.

WP_HTTP_Response::set_headers( array $headers ) #

Sets all header values.


Parameters

$headers

(array)(Required)Map of header name to header value.


Top ↑

Source

File: wp-includes/class-wp-http-response.php

	public function set_headers( $headers ) {
		$this->headers = $headers;
	}


Top ↑

Changelog

Changelog
VersionDescription
4.4.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.