diff --git a/src/wp-admin/admin-footer.php b/src/wp-admin/admin-footer.php index fef0c06bbf725..32f24e536e599 100644 --- a/src/wp-admin/admin-footer.php +++ b/src/wp-admin/admin-footer.php @@ -114,6 +114,14 @@ ?>
- + diff --git a/src/wp-admin/async-upload.php b/src/wp-admin/async-upload.php index 5fbdd370c5c1a..0bd955e5d0428 100644 --- a/src/wp-admin/async-upload.php +++ b/src/wp-admin/async-upload.php @@ -145,7 +145,42 @@ $_FILES['async-upload']['name'] ); - echo '\n"; + $js_function = <<<'JS' + /** + * Announces the upload failure and wires up its dismiss button. + * + * @param {JQueryStatic} $ The jQuery object. + * @param {Object} args PHP exports. + * @param {string} args.speakMessage Message announced to assistive technology. + * @param {string} args.buttonSelector Selector for the notice's dismiss button. + * @return {void} + */ + ( $, { speakMessage, buttonSelector } ) => { + setTimeout( () => wp.a11y.speak( speakMessage ), 1500 ); + $( buttonSelector ).on( 'click', function () { + $( this ) + .parents( 'div.media-item' ) + .slideUp( 200, function () { + $( this ).remove(); + wp.a11y.speak( wp.i18n.__( 'Error dismissed.' ) ); + $( '#plupload-browse-button' ).trigger( 'focus' ); + } ); + } ); + } + JS; + wp_print_inline_script_tag( + sprintf( + '( %s )( jQuery, %s )', + $js_function, + wp_json_encode( + array( + 'speakMessage' => $speak_message, + 'buttonSelector' => 'button#' . $button_unique_id, + ), + JSON_HEX_TAG | JSON_UNESCAPED_SLASHES + ) + ) + ); exit; } diff --git a/src/wp-admin/install.php b/src/wp-admin/install.php index b6b7a08f2a5aa..977e231cccdf1 100644 --- a/src/wp-admin/install.php +++ b/src/wp-admin/install.php @@ -470,17 +470,30 @@ function display_setup_form( $error = null ) { } if ( ! wp_is_mobile() ) { - ?> - - -