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
1 changed files with 11 additions and 2 deletions

View File

@ -262,8 +262,17 @@ function get_the_content( $more_link_text = null, $strip_teaser = false ) {
$post = get_post();
if ( null === $more_link_text )
$more_link_text = __( '(more…)' );
if ( null === $more_link_text ) {
$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 = '';
$has_teaser = false;