Make WordPress Core

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

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

Patch for adding screen reader text to Comments link on Admin Bar.

  • wp-includes/admin-bar.php

    From 9955a1508fcf5fca2776271758e140e166188474 Mon Sep 17 00:00:00 2001
    From: Chris Wilcoxson <chris@slushman.com>
    Date: Mon, 7 Dec 2015 09:08:25 -0600
    Subject: [PATCH] Added screen reader text to Admin Bar Comments links.
    
    ---
     wp-includes/admin-bar.php | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php
    index 2bf56a8..acd5a95 100644
    a b function wp_admin_bar_comments_menu( $wp_admin_bar ) { 
    696696
    697697        $icon  = '<span class="ab-icon"></span>';
    698698        $title = '<span id="ab-awaiting-mod" class="ab-label awaiting-mod pending-count count-' . $awaiting_mod . '">' . number_format_i18n( $awaiting_mod ) . '</span>';
     699        $a11y  = '<span class="screen-reader-text">' . $awaiting_title . '</span>';
    699700
    700701        $wp_admin_bar->add_menu( array(
    701702                'id'    => 'comments',
    702                 'title' => $icon . $title,
     703                'title' => $icon . $title . $a11y,
    703704                'href'  => admin_url('edit-comments.php'),
    704705                'meta'  => array( 'title' => $awaiting_title ),
    705706        ) );