Make WordPress Core

Ticket #34895: #34895-admin-bar-comments.2.patch

File #34895-admin-bar-comments.2.patch, 1.0 KB (added by slushman, 9 years ago)

Better patch using @afercia's and @rachelbaker's feedback. The visible comment bubble includes the aria-hidden, the $title variable is concatenated and includes the screen reader text.

Line 
1From 9955a1508fcf5fca2776271758e140e166188474 Mon Sep 17 00:00:00 2001
2From: Chris Wilcoxson <chris@slushman.com>
3Date: Mon, 7 Dec 2015 09:08:25 -0600
4Subject: [PATCH] Added screen reader text to Admin Bar Comments links.
5
6---
7 wp-includes/admin-bar.php | 3 ++-
8 1 file changed, 2 insertions(+), 1 deletion(-)
9
10diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php
11index 2bf56a8..acd5a95 100644
12--- a/wp-includes/admin-bar.php
13+++ b/wp-includes/admin-bar.php
14@@ -696,10 +696,11 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
15
16        $icon  = '<span class="ab-icon"></span>';
17        $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>';
18+       $title .= '<span class="screen-reader-text">' . $awaiting_title . '</span>';
19
20        $wp_admin_bar->add_menu( array(
21                'id'    => 'comments',
22                'title' => $icon . $title,
23                'href'  => admin_url('edit-comments.php'),
24-               'meta'  => array( 'title' => $awaiting_title ),
25        ) );