WP_REST_Server::send_header( string $key, string $value )
Sends an HTTP header.
Description Description
Parameters Parameters
- $key
-
(string) (Required) Header key.
- $value
-
(string) (Required) Header value.
Source Source
File: wp-includes/rest-api/class-wp-rest-server.php
public function send_header( $key, $value ) { /* * Sanitize as per RFC2616 (Section 4.2): * * Any LWS that occurs between field-content MAY be replaced with a * single SP before interpreting the field value or forwarding the * message downstream. */ $value = preg_replace( '/\s+/', ' ', $value ); header( sprintf( '%s: %s', $key, $value ) ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |