Pass the post ID from the_shortlink() to wp_get_shortlink() to avoid a change in filters. props SergeyBiryukov, fixes #21309.
git-svn-id: https://develop.svn.wordpress.org/trunk@22564 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3841bfba82
commit
24e95b5bd9
@ -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