diff --git a/src/js/media/views/uploader/inline.js b/src/js/media/views/uploader/inline.js index bd2cff0dccc3c..c6bc5fa068fb1 100644 --- a/src/js/media/views/uploader/inline.js +++ b/src/js/media/views/uploader/inline.js @@ -115,6 +115,7 @@ UploaderInline = View.extend(/** @lends wp.media.view.UploaderInline.prototype * $browser.detach().text( $placeholder.text() ); $browser[0].className = $placeholder[0].className; + $browser[0].setAttribute( 'aria-labelledby', $browser[0].id + ' ' + $placeholder[0].getAttribute('aria-labelledby') ); $placeholder.replaceWith( $browser.show() ); } diff --git a/src/js/media/views/uploader/status.js b/src/js/media/views/uploader/status.js index 0be6f15f5d935..a1ab019bda7f9 100644 --- a/src/js/media/views/uploader/status.js +++ b/src/js/media/views/uploader/status.js @@ -111,13 +111,14 @@ UploaderStatus = View.extend(/** @lends wp.media.view.UploaderStatus.prototype * * @param {Backbone.Model} error */ error: function( error ) { + console.log('error!'); var statusError = new wp.media.view.UploaderStatusError( { filename: this.filename( error.get( 'file' ).name ), message: error.get( 'message' ) } ); // Can show additional info here while retrying to create image sub-sizes. - this.views.add( '.upload-errors', statusError, { at: 0 } ); + this.$el.attr( 'tabindex', '-1' ).focus() }; }, dismiss: function() { diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 536f195b14875..a6c63681f8be2 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -7781,3 +7781,123 @@ function is_php_version_compatible( $required ) { function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) { return abs( (float) $expected - (float) $actual ) <= $precision; } + +/** + * Sanitizes an attributes array into an attributes string to be placed inside a `\n", wp_sanitize_script_attributes( $attributes ) ); +} + +/** + * Prints formatted `\n", wp_sanitize_script_attributes( $attributes ), $javascript ); +} + +/** + * Prints inline JavaScript wrapped in `