Make WordPress Core

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

File 36572-link-and-excerpt-linked.3.diff, 1.8 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                $more_link_text = sprintf(
     267                        '<span aria-label="%1$s">%2$s</span>',
     268                        sprintf(
     269                                /* translators: %s: Name of current post */
     270                                __( 'Continue reading %s' ),
     271                                get_the_title()
     272                        ),
     273                        __( '(more&hellip;)' )
     274                );
     275        }
    267276
    268277        $output = '';
    269278        $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 including a link if the `excerpt_more` filter is not used.
     2921                if ( $more_string === $excerpt_more ) {
     2922                        $excerpt_more = sprintf(
     2923                                ' <a href="%1$s" class="more-link"><span aria-label="%2$s">[&hellip;]</span></a>',
     2924                                get_permalink(),
     2925                                sprintf(
     2926                                        /* translators: %s: Post title */
     2927                                        __( 'Continue reading %s' ),
     2928                                        get_the_title()
     2929                                )
     2930                        );
     2931                }
     2932
    29172933                $text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
    29182934        }
    29192935        /**