Make WordPress Core

Changeset 36093


Ignore:
Timestamp:
12/26/2015 01:39:50 AM (9 years ago)
Author:
SergeyBiryukov
Message:

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

Props slushman, rachelbaker.
Fixes #34895.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/admin-bar.php

    r35875 r36093  
    693693    $awaiting_mod = wp_count_comments();
    694694    $awaiting_mod = $awaiting_mod->moderated;
    695     $awaiting_title = esc_attr( sprintf( _n( '%s comment awaiting moderation', '%s comments awaiting moderation', $awaiting_mod ), number_format_i18n( $awaiting_mod ) ) );
     695    $awaiting_text = sprintf( _n( '%s comment awaiting moderation', '%s comments awaiting moderation', $awaiting_mod ), number_format_i18n( $awaiting_mod ) );
    696696
    697697    $icon  = '<span class="ab-icon"></span>';
    698     $title = '<span id="ab-awaiting-mod" class="ab-label awaiting-mod pending-count count-' . $awaiting_mod . '">' . number_format_i18n( $awaiting_mod ) . '</span>';
     698    $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>';
     699    $title .= '<span class="screen-reader-text">' . $awaiting_text . '</span>';
    699700
    700701    $wp_admin_bar->add_menu( array(
     
    702703        'title' => $icon . $title,
    703704        'href'  => admin_url('edit-comments.php'),
    704         'meta'  => array( 'title' => $awaiting_title ),
    705705    ) );
    706706}
Note: See TracChangeset for help on using the changeset viewer.