rest_output_link_wp_head

函数


rest_output_link_wp_head ( No parameters )
相关
  • get_rest_url()
定义位置
  • wp-includes/rest-api.php
    , line 980
引入
4.4.0
弃用

将REST API链接标签输出到页头。

function rest_output_link_wp_head() {
	$api_root = get_rest_url();

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

	printf( '', esc_url( $api_root ) );

	$resource = rest_get_queried_resource_route();

	if ( $resource ) {
		printf( '', esc_url( rest_url( $resource ) ) );
	}
}