WordPress at a glance

wp_shortlink_wp_head() WP 1.0

Injects rel=shortlink into the head if a shortlink is defined for the current page.

Attached to the 'wp_head' action.

Works based on: wp_get_shortlink()

No Hooks.

Return

Null. Nothing.

Usage

wp_shortlink_wp_head();

Changelog

Since 3.0.0 Introduced.

Code of wp shortlink wp head: wp-includes/link-template.php WP 5.2.4

<?php
function wp_shortlink_wp_head() {
	$shortlink = wp_get_shortlink( 0, 'query' );

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

	echo "<link rel='shortlink' href='" . esc_url( $shortlink ) . "' />\n";
}
No comments
    Hello, !     Log In . Register