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

Props slushman, rachelbaker.
Fixes #34895.

git-svn-id: https://develop.svn.wordpress.org/trunk@36093 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-12-26 01:39:50 +00:00
parent 54c918d407
commit 1fdddd302e
1 changed files with 3 additions and 3 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 ),
) ); ) );
} }