mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
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:
parent
7b74142364
commit
61577966d4
@ -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>';
|
||||
|
Loading…
Reference in New Issue
Block a user