diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index f21920f184..584fbc3c28 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -2428,6 +2428,11 @@ var requires = button.options.requires, disabled = false; + // Prevent insertion of attachments if any of them are still uploading + disabled = _.some( selection.models, function( attachment ) { + return attachment.get('uploading') === true; + }); + if ( requires.selection && selection && ! selection.length ) disabled = true; else if ( requires.library && library && ! library.length )