Make WordPress Core

Ticket #32509: 32509.patch

File 32509.patch, 2.2 KB (added by afercia, 10 years ago)
  • src/wp-admin/includes/class-wp-media-list-table.php

     
    316316                $attributes = 'class="column-icon media-icon ' . $mime . '-icon"' . $style;
    317317?>
    318318                <td <?php echo $attributes ?>><?php
    319                         if ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) {
     319                        if ( $this->is_trash || ! $user_can_edit ) {
     320                                // Preserve the original alt attribute for non-linked images.
     321                                $thumb_attr = '';
     322                        } else {
     323                                // For linked images the alt attribute should communicate the destination of the link or action taken.
     324                                $thumb_attr = array( 'alt' => esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) ) );
     325                        }
     326                        if ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true, $thumb_attr ) ) {
    320327                                if ( $this->is_trash || ! $user_can_edit ) {
    321328                                        echo $thumb;
    322329                                } else {
    323330?>
    324                                 <a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) ); ?>">
     331                                <a href="<?php echo get_edit_post_link( $post->ID ); ?>">
    325332                                        <?php echo $thumb; ?>
    326333                                </a>
    327334
     
    338345                        <?php if ( $this->is_trash || ! $user_can_edit ) {
    339346                                echo $att_title;
    340347                        } else { ?>
    341                         <a href="<?php echo get_edit_post_link( $post->ID ); ?>"
    342                                 title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) ); ?>">
    343                                 <?php echo $att_title; ?></a>
     348                        <a href="<?php echo get_edit_post_link( $post->ID ); ?>">
     349                                <span aria-hidden="true"><?php echo $att_title; ?></span>
     350                                <span class="screen-reader-text"><?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) ); ?></span>
     351                        </a>
    344352                        <?php };
    345353                        _media_states( $post ); ?></strong>
    346                         <p class="filename"><?php echo wp_basename( $post->guid ); ?></p>
     354                        <p class="filename"><span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span><?php echo wp_basename( $post->guid ); ?></p>
    347355<?php
    348356                echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
    349357?>