WordPress at a glance
Home All Function Functions APIs REST API

rest_output_link_wp_head() WP 1.0

Outputs the REST API link tag into page header.

  • See: get_rest_url()
Works based on: get_rest_url()
✈ 1 time = 0.004168s = very slow | 50000 times = 4.19s = fast | PHP 7.1.11, WP 4.9.8

No Hooks.

Return

Nothing (null).

Usage

rest_output_link_wp_head();

Code of rest output link wp head: wp-includes/rest-api.php WP 5.2.2

<?php
function rest_output_link_wp_head() {
	$api_root = get_rest_url();

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

	echo "<link rel='https://api.w.org/' href='" . esc_url( $api_root ) . "' />\n";
}

Related Functions

From tag: REST API

No comments
    Hello, !     Log In . Register