From aa1446319d06c89e8e93d261ae82073802715c4a Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Tue, 4 Sep 2012 04:10:00 +0000 Subject: [PATCH] Do not instantiate a Plupload instance when the wp-plupload bridge has neither a browse button nor a dropzone. fixes #21707. git-svn-id: https://develop.svn.wordpress.org/trunk@21722 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/plupload/wp-plupload.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/js/plupload/wp-plupload.js b/wp-includes/js/plupload/wp-plupload.js index 1b228dde87..e9ec49292a 100644 --- a/wp-includes/js/plupload/wp-plupload.js +++ b/wp-includes/js/plupload/wp-plupload.js @@ -73,6 +73,10 @@ if ( typeof wp === 'undefined' ) this.plupload[ elements[ key ] ] = this[ key ].prop('id'); } + // If the uploader has neither a browse button nor a dropzone, bail. + if ( ! ( this.browser && this.browser.length ) && ! ( this.dropzone && this.dropzone.length ) ) + return; + this.uploader = new plupload.Uploader( this.plupload ); delete this.plupload;