Plupload 2.x in WordPress 3.9
Plupload is the library that powers most of the file upload interfaces in WordPress, and in 3.9 we’ve updated the bundled library to version 2.1.1 (#25663). Here are some of things that have changed, which may affect WordPress plugins and themes.
If you’re using direct references to Plupload’s runtime .js files, such as plupload.html5.js, note that these files are now gone. The following script handles were removed:
plupload-html4. If you need to enqueue the Plupload library, just use the
If you’re constructing your own Plupload settings array vs. using
wp_plupload_default_settings() and/or the
_wpPluploadSettings object, note that some of the arguments have changed, most notably:
flash_swf_urlshould point to the new Moxie.swf file
silverlight_xap_urlshould use the new Moxie.xap
multiple_queuesargument is no longer used
max_file_sizekey has been moved to the
filtersarray now supports multiple keys, and the list of file types array has been moved to its
To illustrate that with code:
$settings = array( // ... 'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ), // Unchanged 'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ), // Unchanged 'filters' => array( 'max_file_size' => $max_upload_size . 'b', ), );
Plupload version 2.1.1 has also added some exciting new options and methods, which you can find in the updated documentation.
As a result of this update in WordPress 3.9 we were able to add drag and drop upload support directly to our TinyMCE editor (#19845), and we’ve also added a new boolean flag to
wp_editor(), which you can use to enable drag and drop upload support in your own instance of the editor (#27465):
wp_editor( '', 'my-editor', array( // ... 'drag_drop_upload' => true, ) );
If you run into any problems with this update in 3.9, please leave a comment on this post and we’ll be happy to help you out!
Update: I opened #27763 to address some of the compatibility issues around the update. We might be renaming the swf/xap files for backwards compatibility.
Update, April 13: The original swf/xap filenames were restored.