Make WordPress Core

Opened 14 years ago

Closed 13 years ago

Last modified 3 years ago

#23115 closed enhancement (invalid)

Refactor wp.media.gallery.attachments to accept an array of attachment ids rather than shortcode

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

Description

In /wp-includes/js/media-editor.js, line 175, the wp.media.gallery.attachments method is too closely coupled to the shortcode. This makes it impossible to fetch Attachments without first creating a shortcode to pass in.

A better approach would be to accept an array of attachment ids or a hash of properties; more than just shortcodes need to fetch Attachments by their ids.

Change History (1)

#1 @wonderboymusic
13 years ago

  • Milestone Awaiting Review
  • Resolution → invalid
  • Status new → closed

Thanks for the report. That function is a helper for wp.media.gallery.edit(), it is not really intended to be used for general-use querying. wp.media.query() will do that.

Note: See TracTickets for help on using tickets.