diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php
index 8b6c1a4636..7643668af1 100644
--- a/wp-includes/link-template.php
+++ b/wp-includes/link-template.php
@@ -2199,12 +2199,12 @@ function wp_get_shortlink($id = 0, $context = 'post', $allow_slugs = true) {
* @uses wp_get_shortlink()
*/
function wp_shortlink_wp_head() {
- $shortlink = wp_get_shortlink(0, 'query');
+ $shortlink = wp_get_shortlink( 0, 'query' );
- if ( empty($shortlink) )
+ if ( empty( $shortlink ) )
return;
- echo "\n";
+ echo "\n";
}
/**
@@ -2242,19 +2242,22 @@ function wp_shortlink_header() {
* @param string $before Optional HTML to display before the link.
* @param string $before Optional HTML to display after the link.
*/
-function the_shortlink($text = '', $title = '', $before = '', $after = '') {
+function the_shortlink( $text = '', $title = '', $before = '', $after = '' ) {
global $post;
- if ( empty($text) )
+ if ( empty( $text ) )
$text = __('This is the short link.');
- if ( empty($title) )
- $title = the_title_attribute( array('echo' => FALSE) );
+ if ( empty( $title ) )
+ $title = the_title_attribute( array( 'echo' => FALSE ) );
- $shortlink = wp_get_shortlink($post->ID);
+ $shortlink = wp_get_shortlink( $post->ID );
- if ( !empty($shortlink) )
- echo "$before$text$after";
+ if ( !empty( $shortlink ) ) {
+ $link = '' . $text . '';
+ $link = apply_filters( 'the_shortlink', $link, $shortlink, $text, $title );
+ echo $before, $link, $after;
+ }
}
?>