Ticket #36572: 36572-link-and-excerpt-linked.diff
File 36572-link-and-excerpt-linked.diff, 1.7 KB (added by , 9 years ago) |
---|
-
src/wp-includes/post-template.php
262 262 263 263 $post = get_post(); 264 264 265 if ( null === $more_link_text ) 266 $more_link_text = __( '(more…)' ); 265 if ( null === $more_link_text ) { 266 /* translators: %s: Name of current post */ 267 $more_link_text = sprintf( __( '<span aria-label="Continue reading %s">(more…)</span>' ), get_the_title() ); 268 } 267 269 268 270 $output = ''; 269 271 $has_teaser = false; -
src/wp-includes/formatting.php
2906 2906 * @param int $number The number of words. Default 55. 2907 2907 */ 2908 2908 $excerpt_length = apply_filters( 'excerpt_length', 55 ); 2909 2910 $more_string = ' […]'; 2909 2911 /** 2910 2912 * Filter the string in the "more" link displayed after a trimmed excerpt. 2911 2913 * … … 2913 2915 * 2914 2916 * @param string $more_string The string shown within the more link. 2915 2917 */ 2916 $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[…]' ); 2918 $excerpt_more = apply_filters( 'excerpt_more', $more_string ); 2919 2920 // add a more accessible default including a link if the `excerpt_more` filter is not used. 2921 if ( $more_string === $excerpt_more ) { 2922 $excerpt_more = ' <a href="' . get_permalink() . '" class="more-link">' . sprintf( 2923 /* translators: %s: Name of current post */ 2924 __( '<span aria-label="Continue reading %s"> […]</span>' ), 2925 get_the_title() 2926 ) . '</a>'; 2927 } 2928 2917 2929 $text = wp_trim_words( $text, $excerpt_length, $excerpt_more ); 2918 2930 } 2919 2931 /**