Make WordPress Core


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.

File:
1 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>';
Note: See TracChangeset for help on using the changeset viewer.