Themes: Make default "read more" link more accessible.

Add an `aria-label` with the post title to make it available for screen readers.

Props Kau-Boy.
Fixes #36572.

git-svn-id: https://develop.svn.wordpress.org/trunk@37706 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2016-06-14 22:45:10 +00:00
parent 661f5a477e
commit 2e79b18178

View File

@ -262,8 +262,17 @@ function get_the_content( $more_link_text = null, $strip_teaser = false ) {
$post = get_post(); $post = get_post();
if ( null === $more_link_text ) if ( null === $more_link_text ) {
$more_link_text = __( '(more…)' ); $more_link_text = sprintf(
'<span aria-label="%1$s">%2$s</span>',
sprintf(
/* translators: %s: Name of current post */
__( 'Continue reading %s' ),
the_title_attribute( array( 'echo' => false ) )
),
__( '(more&hellip;)' )
);
}
$output = ''; $output = '';
$has_teaser = false; $has_teaser = false;