Ticket #10640: 13693.2.diff
File 13693.2.diff, 1.2 KB (added by , 15 years ago) |
---|
-
wp-includes/link-template.php
2143 2143 * @param string $before Optional HTML to display before the link. 2144 2144 * @param string $before Optional HTML to display after the link. 2145 2145 */ 2146 function the_shortlink( $text = '', $title = '', $before = '', $after = '') {2146 function the_shortlink( $text = '', $title = '', $before = '', $after = '' ) { 2147 2147 global $post; 2148 2148 2149 if ( empty( $text) )2149 if ( empty( $text ) ) 2150 2150 $text = __('This is the short link.'); 2151 2151 2152 if ( empty( $title) )2153 $title = the_title_attribute( array( 'echo' => FALSE) );2152 if ( empty( $title ) ) 2153 $title = the_title_attribute( array( 'echo' => FALSE ) ); 2154 2154 2155 $shortlink = wp_get_shortlink( $post->ID);2155 $shortlink = wp_get_shortlink( $post->ID ); 2156 2156 2157 if ( !empty($shortlink) ) 2158 echo "$before<a rel='shortlink' href='$shortlink' title='$title'>$text</a>$after"; 2157 if ( !empty( $shortlink ) ) { 2158 $link = '<a rel="shortlink" href="' . esc_attr( $shortlink ) . '" title="' . $title . '">' . $text . '</a>'; 2159 $link = apply_filters( 'the_shortlink', $link, $shortlink, $text, $title ); 2160 echo $before, $link, $after; 2161 } 2159 2162 } 2160 2163 2161 2164 ?>