From 262b3bd9b1a725aea8edb79fdfd68d33d1dd9e37 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 10 Apr 2013 22:26:55 +0000 Subject: [PATCH] Don't allow images to be set as featured image until they have been processed. props kadamwhite. fixes #23317. git-svn-id: http://core.svn.wordpress.org/trunk@23956 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/media-views.js | 5 +++++ 1 file changed, 5 insertions(+) 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 )