rest_output_link_wp_head

Outputs the REST API link tag into page header.

Description

rest_output_link_wp_head(); 

Usage

  1. if ( !function_exists( 'rest_output_link_wp_head' ) ) { 
  2. require_once ABSPATH . WPINC . '/rest-api.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = rest_output_link_wp_head(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/rest-api.php  
  1. function rest_output_link_wp_head() { 
  2. $api_root = get_rest_url(); 
  3.  
  4. if ( empty( $api_root ) ) { 
  5. return; 
  6.  
  7. echo "<link rel='https://api.w.org/' href='" . esc_url( $api_root ) . "' />\n";