From 45d01dad51648480becee87aa075328b243db30c Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Fri, 4 Jan 2013 06:44:21 +0000 Subject: [PATCH] Media: Automatically select uploading attachments in single-select workflows. The code now automatically selects uploading attachments in all workflows. In a workflow that selects multiple attachments, all attachments added to the upload queue are selected. In a workflow that selects a single attachment (e.g. selecting a featured image), the last attachment added to the upload queue is selected. see #22817. git-svn-id: https://develop.svn.wordpress.org/trunk@23259 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/media-views.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index 6ce8470a40..aa079ef235 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -533,10 +533,12 @@ if ( 'upload' === content.mode() ) this.frame.content.mode('browse'); - // If we're in a workflow that supports multiple attachments, - // automatically select any uploading attachments. - if ( this.get('multiple') ) - this.get('selection').add( attachment ); + // Automatically select any uploading attachments. + // + // Selections that don't support multiple attachments automatically + // limit themselves to one attachment (in this case, the last + // attachment in the upload queue). + this.get('selection').add( attachment ); }, saveContentMode: function() {