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.
Works based on: wp_get_shortlink()
No Hooks.
Return
Null. Nothing.
Usage
wp_shortlink_header();
Changelog
Since 3.0.0 | Introduced. |
Code of wp_shortlink_header() wp shortlink header WP 5.6.2
function wp_shortlink_header() {
if ( headers_sent() ) {
return;
}
$shortlink = wp_get_shortlink( 0, 'query' );
if ( empty( $shortlink ) ) {
return;
}
header( 'Link: <' . $shortlink . '>; rel=shortlink', false );
}