WP_HTTP_Requests_Response::set_headers() WordPress Method
The set_headers() method is used to set the headers for the HTTP response. The headers are set as an array of key/value pairs. The keys are the header names and the values are the header values.
WP_HTTP_Requests_Response::set_headers( array $headers ) #
Sets all header values.
Contents
Parameters
- $headers
(array)(Required)Map of header name to header value.
Source
File: wp-includes/class-wp-http-requests-response.php
public function set_headers( $headers ) { $this->response->headers = new Requests_Response_Headers( $headers ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.6.0 | Introduced. |