Class: PersistentDisplaySettingsLibrary

wp.mediaWidgets. PersistentDisplaySettingsLibrary


new PersistentDisplaySettingsLibrary(options)

Library which persists the customized display settings across selections.
Parameters:
Name Type Description
options Object Options.
Source:
Returns:
Type
void

Extends

Methods


<private> [undefined]()

Inherited From:
Source:

<private> _deactivate()

Since:
  • 3.5.0
Inherited From:
Source:

<private> _menu()

Since:
  • 3.5.0
Inherited From:
Source:

<private> _postActivate()

Since:
  • 3.5.0
Inherited From:
Source:

<private> _preActivate()

Since:
  • 3.5.0
Inherited From:
Source:

<private> _ready()

Since:
  • 3.5.0
Inherited From:
Source:

<private> _renderMenu(view)

Create a view in the media menu for the state.
Parameters:
Name Type Description
view media.view.Menu The menu view.
Since:
  • 3.5.0
Inherited From:
Source:

<private> _renderTitle()

Since:
  • 3.5.0
Inherited From:
Source:

<private> _router()

Since:
  • 3.5.0
Inherited From:
Source:

<private> _title()

Since:
  • 3.5.0
Inherited From:
Source:

<private> _updateMenu()

Since:
  • 3.5.0
Inherited From:
Source:

activate()

Since:
  • 3.5.0
Inherited From:
Source:

canEmbed(attachment)

Whether an attachment can be embedded (audio or video).
Parameters:
Name Type Description
attachment wp.media.model.Attachment
Since:
  • 3.6.0
Inherited From:
Source:
Returns:
Type
Boolean

constructor()

Constructor.
Since:
  • 3.5.0
Inherited From:
Source:

deactivate()

Since:
  • 3.5.0
Inherited From:
Source:

defaultDisplaySettings(attachment)

Given an attachment, create attachment display settings properties.
Parameters:
Name Type Description
attachment wp.media.model.Attachment
Since:
  • 3.6.0
Inherited From:
Source:
Returns:
Type
Object

display(model)

Get the display settings model. Model returned is updated with the current customized display settings, and an event listener is added so that changes made to the settings will sync back into the model storing the session's customized display settings.
Parameters:
Name Type Description
model Backbone.Model Display settings model.
Overrides:
Source:
Returns:
Display settings model.
Type
Backbone.Model

handleDisplaySettingChange(displaySettings)

Sync changes to the current display settings back into the current customized.
Parameters:
Name Type Description
displaySettings Backbone.Model Modified display settings.
Source:
Returns:
Type
void

initialize()

If a library isn't provided, query all media items. If a selection instance isn't provided, create one.
Since:
  • 3.5.0
Inherited From:
Source:

isImageAttachment(attachment)

Whether an attachment is image.
Parameters:
Name Type Description
attachment wp.media.model.Attachment
Since:
  • 4.4.1
Inherited From:
Source:
Returns:
Type
Boolean

<abstract> ready()

Ready event callback.
Since:
  • 3.5.0
Inherited From:
Source:

refreshContent()

If the state is active, no items are selected, and the current content mode is not an option in the state's router (provided the state has a router), reset the content mode to the default.
Since:
  • 3.5.0
Inherited From:
Source:

reset()

Reset the library to its initial state.
Since:
  • 3.5.0
Inherited From:
Source:

resetDisplays()

Reset the attachment display settings defaults to the site options. If site options don't define them, fall back to a persistent user setting.
Since:
  • 3.5.0
Inherited From:
Source:

saveContentMode()

Persist the mode of the content region as a user setting.
Since:
  • 3.5.0
Inherited From:
Source:

uploading(attachment)

Callback handler when an attachment is uploaded. Switch to the Media Library if uploaded from the 'Upload Files' tab. Adds any uploading attachments to the selection. If the state only supports one attachment to be selected and multiple attachments are uploaded, the last attachment in the upload queue will be selected.
Parameters:
Name Type Description
attachment wp.media.model.Attachment
Since:
  • 3.5.0
Inherited From:
Source: