Make WordPress Core

Ticket #36572: 36572-link-and-excerpt.diff

File 36572-link-and-excerpt.diff, 1.6 KB (added by Kau-Boy, 9 years ago)
  • src/wp-includes/post-template.php

     
    262262
    263263        $post = get_post();
    264264
    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&hellip;)</span>' ), get_the_title() );
     268        }
    267269
    268270        $output = '';
    269271        $has_teaser = false;
  • src/wp-includes/formatting.php

     
    29062906                 * @param int $number The number of words. Default 55.
    29072907                 */
    29082908                $excerpt_length = apply_filters( 'excerpt_length', 55 );
     2909
     2910                $more_string = ' [&hellip;]';
    29092911                /**
    29102912                 * Filter the string in the "more" link displayed after a trimmed excerpt.
    29112913                 *
     
    29132915                 *
    29142916                 * @param string $more_string The string shown within the more link.
    29152917                 */
    2916                 $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[&hellip;]' );
     2918                $excerpt_more = apply_filters( 'excerpt_more', $more_string );
     2919
     2920                // add a more accessible default if the `excerpt_more` filter is not used.
     2921                if ( $more_string === $excerpt_more ) {
     2922                        /* translators: %s: Name of current post */
     2923                        $excerpt_more = sprintf( __( '<span aria-label="Continue reading %s"> [&hellip;]</span>' ), get_the_title() );
     2924                }
     2925
    29172926                $text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
    29182927        }
    29192928        /**