Pass the post ID from the_shortlink() to wp_get_shortlink() to avoid a change in filters. props SergeyBiryukov, fixes #21309.

git-svn-id: http://core.svn.wordpress.org/trunk@22564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-11-14 05:05:34 +00:00
parent 7b74142364
commit 61577966d4
1 changed files with 3 additions and 1 deletions

View File

@ -2421,13 +2421,15 @@ function wp_shortlink_header() {
* @param string $after Optional HTML to display after the link.
*/
function the_shortlink( $text = '', $title = '', $before = '', $after = '' ) {
$post = get_post();
if ( empty( $text ) )
$text = __('This is the short link.');
if ( empty( $title ) )
$title = the_title_attribute( array( 'echo' => false ) );
$shortlink = wp_get_shortlink();
$shortlink = wp_get_shortlink( $post->ID );
if ( !empty( $shortlink ) ) {
$link = '<a rel="shortlink" href="' . esc_url( $shortlink ) . '" title="' . $title . '">' . $text . '</a>';