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. Built from https://develop.svn.wordpress.org/trunk@42784 git-svn-id: http://core.svn.wordpress.org/trunk@42614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -90,7 +90,7 @@ if ( isset( $_REQUEST['post_id'] ) ) {
|
||||
$id = media_handle_upload( 'async-upload', $post_id );
|
||||
if ( is_wp_error( $id ) ) {
|
||||
echo '<div class="error-div error">
|
||||
<a class="dismiss" href="#" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">' . __( 'Dismiss' ) . '</a>
|
||||
<button type="button" class="dismiss button-link" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">' . __( 'Dismiss' ) . '</button>
|
||||
<strong>' . sprintf( __( '“%s” has failed to upload.' ), esc_html( $_FILES['async-upload']['name'] ) ) . '</strong><br />' .
|
||||
esc_html( $id->get_error_message() ) . '</div>';
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user