wp_shortlink_header

Sends a Link: rel=shortlink header if a shortlink is defined for the current page.

Description

wp_shortlink_header(); 

Attached to the action.


Usage

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

Defined (1)

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

/wp-includes/link-template.php  
  1. function wp_shortlink_header() { 
  2. if ( headers_sent() ) 
  3. return; 
  4.  
  5. $shortlink = wp_get_shortlink(0, 'query'); 
  6.  
  7. if ( empty($shortlink) ) 
  8. return; 
  9.  
  10. header('Link: <' . $shortlink . '>; rel=shortlink', false);