From ef84e589d2bc25952bee31940a5a11c3fa75f599 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Mon, 5 Mar 2018 15:32:54 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@42784 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/async-upload.php | 2 +- src/wp-admin/css/media.css | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/async-upload.php b/src/wp-admin/async-upload.php index ffdfda097e..cf4670bbb1 100644 --- a/src/wp-admin/async-upload.php +++ b/src/wp-admin/async-upload.php @@ -90,7 +90,7 @@ if ( isset( $_REQUEST['post_id'] ) ) { $id = media_handle_upload( 'async-upload', $post_id ); if ( is_wp_error( $id ) ) { echo '
- ' . __( 'Dismiss' ) . ' + ' . sprintf( __( '“%s” has failed to upload.' ), esc_html( $_FILES['async-upload']['name'] ) ) . '
' . esc_html( $id->get_error_message() ) . '
'; exit; diff --git a/src/wp-admin/css/media.css b/src/wp-admin/css/media.css index f84741bc1d..36ddb94afd 100644 --- a/src/wp-admin/css/media.css +++ b/src/wp-admin/css/media.css @@ -211,8 +211,7 @@ padding: 10px 0 10px 14px; } -.media-item .error-div a.dismiss { - display: block; +.media-item .error-div button.dismiss { float: right; margin: 0 10px 0 15px; }