wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
rest_output_link_header › WordPress Function
Seit4.4.0
Veraltetn/v
› rest_output_link_header ( Keine Parameter )
| Definiert in: |
|
| Codex: |
Sends a Link header for the REST API.
Ähnliche Funktionen: rest_output_link_wp_head, rest_output_rsd, register_column_headers, get_column_headers, wp_shortlink_header
Quellcode
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: <%1$s>; rel="alternate"; title="%2$s"; type="application/json"',
sanitize_url( rest_url( $resource ) ),
_x( 'JSON', 'REST API resource link name' )
),
false
);
}
}