wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



rest_output_link_header › WordPress Function

Od4.4.0
Przestarzałyn/a
rest_output_link_header ( Brak parametrów )
Zdefiniowane na:
Codex:

Sends a Link header for the REST API.



Źródło

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/"', sanitize_url( $api_root ) ), false );

	$resource = rest_get_queried_resource_route();

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