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.
Built from https://develop.svn.wordpress.org/trunk@37706


git-svn-id: http://core.svn.wordpress.org/trunk@37672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2016-06-14 22:46:27 +00:00
parent c4cdc9e7ad
commit aad01818a5
2 changed files with 12 additions and 3 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;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37705';
$wp_version = '4.6-alpha-37706';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.