Summery Summery
Sets headers on the request.
Syntax Syntax
Parameters Parameters
- $headers
-
(Required) Map of header name to value.
- $override
-
(Optional) If true, replace the request's headers. Otherwise, merge with existing.
Default value: true
Source Source
File: wp-includes/rest-api/class-wp-rest-request.php
public function set_headers( $headers, $override = true ) {
if ( true === $override ) {
$this->headers = array();
}
foreach ( $headers as $key => $value ) {
$this->set_header( $key, $value );
}
}
Advertisement
Changelog Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |