Make WordPress Core

Changeset 53414

Timestamp:
05/19/2022 03:52:03 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Accessibility: List Tables: Hide the Comments column icon and title attribute from screen readers.

The element already has non-visual text, making the icon and the title attribute redundant for assistive technologies.

Follow-up to [22439], [27548], [31513], [32991], [50804].

Props sabernhardt, ryokuhi, afercia, karlgroves, SergeyBiryukov.
Fixes #55555. See #24766.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r53302 r53414  
    351351        if ( ! $this->detached ) {
    352352            $posts_columns['parent'] = _x( 'Uploaded to', 'column name' );
     353
    353354            if ( post_type_supports( 'attachment', 'comments' ) ) {
    354                 $posts_columns['comments'] = '<span class="vers comment-grey-bubble" title="' . esc_attr__( 'Comments' ) . '"><span class="screen-reader-text">' . __( 'Comments' ) . '</span></span>';
     355                $posts_columns['comments'] = sprintf(
     356                    '<span class="vers comment-grey-bubble" title="%1$s" aria-hidden="true"></span><span class="screen-reader-text">%2$s</span>',
     357                    esc_attr__( 'Comments' ),
     358                    __( 'Comments' )
     359                );
    355360            }
    356361        }
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r53352 r53414  
    692692        ) {
    693693            $posts_columns['comments'] = sprintf(
    694                 '<span class="vers comment-grey-bubble" title="%1$s"><span class="screen-reader-text">%2$s</span></span>',
     694                '<span class="vers comment-grey-bubble" title="%1$s"</span>',
    695695                esc_attr__( 'Comments' ),
    696696                __( 'Comments' )
Note: See TracChangeset for help on using the changeset viewer.