Summery Summery
Sets a single link header.
Syntax Syntax
Parameters Parameters
- $rel
-
(Required) Link relation. Either an IANA registered type, or an absolute URL.
- $link
-
(Required) Target IRI for the link.
- $other
-
(Optional) Other parameters to send, as an assocative array.
Default value: array()
Source Source
File: wp-includes/rest-api/class-wp-rest-response.php
public function link_header( $rel, $link, $other = array() ) { $header = '<' . $link . '>; rel="' . $rel . '"'; foreach ( $other as $key => $value ) { if ( 'title' === $key ) { $value = '"' . $value . '"'; } $header .= '; ' . $key . '=' . $value; } $this->header( 'Link', $header, false ); }
Advertisement
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |