wp_shortlink_wp_head() WordPress Function
The wp_shortlink_wp_head() function allows you to create a shortlink for your WordPress site. This function is useful for creating a short URL that you can share with others.
wp_shortlink_wp_head() #
Injects rel=shortlink into the head if a shortlink is defined for the current page.
Description
Attached to the ‘wp_head’ action.
Source
File: wp-includes/link-template.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"; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |