WordPress at a glance

wp_shortlink_header() WP 1.0

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

Attached to the 'wp' action.

No Hooks.

Return

Nothing (null).

Usage

wp_shortlink_header();

Code of wp shortlink header: wp-includes/link-template.php WP 5.2.2

<?php
function wp_shortlink_header() {
	if ( headers_sent() ) {
		return;
	}

	$shortlink = wp_get_shortlink( 0, 'query' );

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

	header( 'Link: <' . $shortlink . '>; rel=shortlink', false );
}
No comments
    Hello, !     Log In . Register