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
This commit is contained in:
parent
3fe0cb97a5
commit
ef84e589d2
@ -90,7 +90,7 @@ if ( isset( $_REQUEST['post_id'] ) ) {
|
|||||||
$id = media_handle_upload( 'async-upload', $post_id );
|
$id = media_handle_upload( 'async-upload', $post_id );
|
||||||
if ( is_wp_error( $id ) ) {
|
if ( is_wp_error( $id ) ) {
|
||||||
echo '<div class="error-div error">
|
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 />' .
|
<strong>' . sprintf( __( '“%s” has failed to upload.' ), esc_html( $_FILES['async-upload']['name'] ) ) . '</strong><br />' .
|
||||||
esc_html( $id->get_error_message() ) . '</div>';
|
esc_html( $id->get_error_message() ) . '</div>';
|
||||||
exit;
|
exit;
|
||||||
|
@ -211,8 +211,7 @@
|
|||||||
padding: 10px 0 10px 14px;
|
padding: 10px 0 10px 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.media-item .error-div a.dismiss {
|
.media-item .error-div button.dismiss {
|
||||||
display: block;
|
|
||||||
float: right;
|
float: right;
|
||||||
margin: 0 10px 0 15px;
|
margin: 0 10px 0 15px;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user