wpseek.com
WordPress开发者和主题制作者的搜索引擎



rest_output_link_wp_head › WordPress Function

Since4.4.0
已弃用n/a
rest_output_link_wp_head ( 没有参数 )
查看:
定义在:
文档:

Outputs the REST API link tag into page header.



源码

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

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

	printf( '<link rel="https://api.w.org/" href="%s" />', esc_url( $api_root ) );

	$resource = rest_get_queried_resource_route();

	if ( $resource ) {
		printf( '<link rel="alternate" type="application/json" href="%s" />', esc_url( rest_url( $resource ) ) );
	}
}