WordPress.org

Make WordPress Core

#21868 closed task (blessed) (fixed)

Use JS Attachment models in wp.Uploader

Reported by: koopersmith Owned by: koopersmith
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords:
Focuses: Cc:

Description

Currently, wp.Uploader returns a JSON object that was a precursor to the new JS attachment models. Given the introduction of the new media JS APIs and the internal nature of wp.Uploader in 3.4, we should update the API to work with the new media conventions.

wp.Uploader should probably also be aliased to wp.media.Uploader.

Change History (1)

comment:1 koopersmith20 months ago

  • Owner set to koopersmith
  • Resolution set to fixed
  • Status changed from new to closed

In [21814]:

Use JS Attachment models in wp.Uploader. fixes #21868.

Moves the uploading Attachments queue from the media workspace view to the uploader itself. This ensures that all attachments are added to the central attachmnet store.

Updates wp.Uploader to pass Attachment models to callbacks instead of Plupload file objects. Attachments in the process of uploading have a reference to the file object (which can be fetched by calling attachment.get('file');).

Also updates the customizer to be compatible with the API changes.

Note: See TracTickets for help on using tickets.