Sets a single link header.
(string) (Required) Link relation. Either an IANA registered type, or an absolute URL.
(string) (Required) Target IRI for the link.
(array) (Optional) Other parameters to send, as an assocative array.
Default value: array()
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 ); }
Version | Description |
---|---|
4.4.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_response/link_header