Changeset 60263
- Timestamp:
- 05/29/2025 07:51:28 PM (6 weeks ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/media/views/uploader/status.js
r51123 r60263 125 125 _.delay( function() { 126 126 buttonClose.trigger( 'focus' ); 127 wp.a11y.speak( error.get( 'message' ), 'assertive' );128 127 }, 1000 ); 128 129 _.delay( function() { 130 wp.a11y.speak( error.get( 'message' ) ); 131 }, 1500 ); 129 132 }, 130 133 … … 136 139 } 137 140 wp.Uploader.errors.reset(); 141 wp.a11y.speak( wp.i18n.__( 'Error dismissed.' ) ); 138 142 // Move focus to the modal after the dismiss button gets removed from the DOM. 139 143 if ( this.controller.modal ) { -
trunk/src/wp-admin/async-upload.php
r59986 r60263 113 113 $id = media_handle_upload( 'async-upload', $post_id ); 114 114 if ( is_wp_error( $id ) ) { 115 $button_unique_id = uniqid( 'dismiss-' ); 116 $message = sprintf( 115 $button_unique_id = uniqid( 'dismiss-' ); 116 $error_description_id = uniqid( 'error-description-' ); 117 $message = sprintf( 117 118 '%s <strong>%s</strong><br />%s', 118 119 sprintf( 119 '<button type="button" id="% s" class="dismiss button-link">%s</button>',120 '<button type="button" id="%1$s" class="dismiss button-link" aria-describedby="%2$s">%3$s</button>', 120 121 esc_attr( $button_unique_id ), 122 esc_attr( $error_description_id ), 121 123 __( 'Dismiss' ) 122 124 ), … … 128 130 esc_html( $id->get_error_message() ) 129 131 ); 132 130 133 wp_admin_notice( 131 134 $message, 132 135 array( 136 'id' => $error_description_id, 133 137 'additional_classes' => array( 'error-div', 'error' ), 134 138 'paragraph_wrap' => false, 135 139 ) 136 140 ); 137 echo "<script>jQuery( 'button#{$button_unique_id}' ).on( 'click', function() {jQuery(this).parents('div.media-item').slideUp(200, function(){jQuery(this).remove();})});</script>\n"; 141 142 $speak_message = sprintf( 143 /* translators: %s: Name of the file that failed to upload. */ 144 __( '%s has failed to upload.' ), 145 esc_js( $_FILES['async-upload']['name'] ) 146 ); 147 148 echo "<script>_.delay(function() {wp.a11y.speak('" . esc_js( $speak_message ) . "');}, 1500);jQuery( 'button#{$button_unique_id}' ).on( 'click', function() {jQuery(this).parents('div.media-item').slideUp(200, function(){jQuery(this).remove();wp.a11y.speak( wp.i18n.__( 'Error dismissed.' ) );jQuery( '#plupload-browse-button' ).trigger( 'focus' );})});</script>\n"; 138 149 exit; 139 150 }
Note: See TracChangeset
for help on using the changeset viewer.