Summery Summery
Sets a single HTTP header.
Syntax Syntax
Parameters Parameters
- $key
-
(Required) Header name.
- $value
-
(Required) Header value.
- $replace
-
(Optional) Whether to replace an existing header of the same name.
Default value: true
Source Source
File: wp-includes/class-wp-http-response.php
public function header( $key, $value, $replace = true ) { if ( $replace || ! isset( $this->headers[ $key ] ) ) { $this->headers[ $key ] = $value; } else { $this->headers[ $key ] .= ', ' . $value; } }
Advertisement
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |