From fefc19f7bee542258b2003209cad7242aa5e5c0f 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: http://core.svn.wordpress.org/trunk@21722 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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;