wp_shortlink_header

Advertisement

Summery Summery

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

Syntax Syntax

wp_shortlink_header()

Description Description

Attached to the ‘wp’ action.

Source Source

File: wp-includes/link-template.php

 * Attached to the {@see 'wp_head'} action.
 *
 * @since 3.0.0
 */
function wp_shortlink_wp_head() {
	$shortlink = wp_get_shortlink( 0, 'query' );

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

	echo "<link rel='shortlink' href='" . esc_url( $shortlink ) . "' />\n";
}

Advertisement

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Advertisement

Leave a Reply