Class: collection

wp.media. collection


new collection(attributes)

Parameters:
Name Type Description
attributes Object
Source:

Methods


attachments(shortcode)

Retrieve attachments based on the properties of the passed shortcode
Parameters:
Name Type Description
shortcode wp.shortcode An instance of wp.shortcode().
Source:
Returns:
A Backbone.Collection containing the media items belonging to a collection. The query[ this.tag ] property is a Backbone.Model containing the 'props' for the collection.
Type
wp.media.model.Attachments

edit(content)

Triggered when double-clicking a collection shortcode placeholder in the editor
This:
  • wp.media.{prop}
Parameters:
Name Type Description
content string Content that is searched for possible shortcode markup matching the passed tag name,
Source:
Returns:
A media workflow.
Type
wp.media.view.MediaFrame.Select

shortcode(attachments)

Triggered when clicking 'Insert {label}' or 'Update {label}'
Parameters:
Name Type Description
attachments wp.media.model.Attachments A Backbone.Collection containing the media items belonging to a collection. The query[ this.tag ] property is a Backbone.Model containing the 'props' for the collection.
Source:
Returns:
Type
wp.shortcode