Toolbar: In Comments link, replace title attribute containing the number of pending comments with a screen reader text.

Props slushman, rachelbaker.
Fixes #34895.
Built from https://develop.svn.wordpress.org/trunk@36093


git-svn-id: http://core.svn.wordpress.org/trunk@36058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-12-26 01:40:27 +00:00
parent 7270205975
commit 63cc66469b
2 changed files with 4 additions and 4 deletions

View File

@ -692,16 +692,16 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
$awaiting_mod = wp_count_comments(); $awaiting_mod = wp_count_comments();
$awaiting_mod = $awaiting_mod->moderated; $awaiting_mod = $awaiting_mod->moderated;
$awaiting_title = esc_attr( sprintf( _n( '%s comment awaiting moderation', '%s comments awaiting moderation', $awaiting_mod ), number_format_i18n( $awaiting_mod ) ) ); $awaiting_text = sprintf( _n( '%s comment awaiting moderation', '%s comments awaiting moderation', $awaiting_mod ), number_format_i18n( $awaiting_mod ) );
$icon = '<span class="ab-icon"></span>'; $icon = '<span class="ab-icon"></span>';
$title = '<span id="ab-awaiting-mod" class="ab-label awaiting-mod pending-count count-' . $awaiting_mod . '">' . number_format_i18n( $awaiting_mod ) . '</span>'; $title = '<span id="ab-awaiting-mod" class="ab-label awaiting-mod pending-count count-' . $awaiting_mod . '" aria-hidden="true">' . number_format_i18n( $awaiting_mod ) . '</span>';
$title .= '<span class="screen-reader-text">' . $awaiting_text . '</span>';
$wp_admin_bar->add_menu( array( $wp_admin_bar->add_menu( array(
'id' => 'comments', 'id' => 'comments',
'title' => $icon . $title, 'title' => $icon . $title,
'href' => admin_url('edit-comments.php'), 'href' => admin_url('edit-comments.php'),
'meta' => array( 'title' => $awaiting_title ),
) ); ) );
} }

View File

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