Make WordPress Core

Changeset 42784


Ignore:
Timestamp:
03/05/2018 03:32:54 PM (7 years ago)
Author:
afercia
Message:

Accessibility: Change the media upload "Dismiss error" link to a button.

For better accessibility and semantics, user interface controls that perform an
action should be buttons. Links should exclusively be used for navigation.

Props Cheffheid, audrasjb.
Fixes #38671.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/async-upload.php

    r42343 r42784  
    9191if ( is_wp_error( $id ) ) {
    9292    echo '<div class="error-div error">
    93     <a class="dismiss" href="#" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">' . __( 'Dismiss' ) . '</a>
     93    <button type="button" class="dismiss button-link" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">' . __( 'Dismiss' ) . '</button>
    9494    <strong>' . sprintf( __( '&#8220;%s&#8221; has failed to upload.' ), esc_html( $_FILES['async-upload']['name'] ) ) . '</strong><br />' .
    9595    esc_html( $id->get_error_message() ) . '</div>';
  • trunk/src/wp-admin/css/media.css

    r42642 r42784  
    212212}
    213213
    214 .media-item .error-div a.dismiss {
    215     display: block;
     214.media-item .error-div button.dismiss {
    216215    float: right;
    217216    margin: 0 10px 0 15px;
Note: See TracChangeset for help on using the changeset viewer.