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
This commit is contained in:
Daryl Koopersmith 2012-09-04 04:10:00 +00:00
parent 21c4b2913c
commit fefc19f7be
1 changed files with 4 additions and 0 deletions

View File

@ -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;