WordPress at a glance
function is not described

rest_output_link_header() WP 4.4.0

Sends a Link header for the REST API.

No Hooks.

Return

null. Nothing.

Usage

rest_output_link_header();

Changelog

Since 4.4.0 Introduced.

Code of rest_output_link_header() WP 5.7.2

<?php
function rest_output_link_header() {
	if ( headers_sent() ) {
		return;
	}

	$api_root = get_rest_url();

	if ( empty( $api_root ) ) {
		return;
	}

	header( sprintf( 'Link: <%s>; rel="https://api.w.org/"', esc_url_raw( $api_root ) ), false );

	$resource = rest_get_queried_resource_route();

	if ( $resource ) {
		header( sprintf( 'Link: <%s>; rel="alternate"; type="application/json"', esc_url_raw( rest_url( $resource ) ) ), false );
	}
}