Class: Uploader

wp. Uploader


new Uploader(options)

A WordPress uploader. The Plupload library provides cross-browser uploader UI integration. This object bridges the Plupload API to integrate uploads into the WordPress back end and the WordPress media experience.
Parameters:
Name Type Description
options object The options passed to the new plupload instance.
Properties
Name Type Description
container object The id of uploader container.
browser object The id of button to trigger the file select.
dropzone object The id of file drop target.
plupload object An object of parameters to pass to the plupload instance.
params object An object of parameters to pass to $_POST when uploading the file. Extends this.plupload.multipart_params under the hood.
Source:

Methods


init()

Make a few internal event callbacks available on the wp.Uploader object to change the Uploader internals if absolutely necessary.
Source:

param()

Acts as a shortcut to extending the uploader's multipart_params object. param( key ) Returns the value of the key. param( key, value ) Sets the value of a key. param( map ) Sets values for a map of data.
Source:

<inner> error(message, data, file)

Custom error callback. Add a new error to the errors collection, so other modules can track and display errors. @see wp.Uploader.errors.
Parameters:
Name Type Description
message string
data object
file plupload.File File that was uploaded.
Source: