发送REST API的链接头。
原型
rest_output_link_header()
源文件
路径:wp-includes/rest-api.php
<?php
...
function rest_output_link_header() {
if ( headers_sent() ) {
return;
}
$api_root = get_rest_url();
if ( empty( $api_root ) ) {
return;
}
header( 'Link: <' . esc_url_raw( $api_root ) . '>; rel="https://api.w.org/"', false );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/rest_output_link_header/