Namespace: mediaWidgets

wp. mediaWidgets

Classes

MediaEmbedView
MediaFrameSelect
MediaWidgetControl
MediaWidgetModel
PersistentDisplaySettingsLibrary
Constructor
GalleryDetailsMediaFrame

Members


<static> component.controlConstructors :Object:.<string:, wp.mediaWidgets.MediaWidgetModel:>

Widget control (view) constructors, mapping widget id_base to subclass of MediaWidgetControl. Media widgets register themselves by assigning subclasses of MediaWidgetControl onto this object by widget ID base.
Type:
Source:

<static> component.modelCollection :Backbone.Collection

Collection of all widget model instances.
Type:
  • Backbone.Collection
Source:

<static> component.modelConstructors :Object:.<string:, wp.mediaWidgets.MediaWidgetModel:>

Widget model constructors, mapping widget id_base to subclass of MediaWidgetModel. Media widgets register themselves by assigning subclasses of MediaWidgetControl onto this object by widget ID base.
Type:
Source:

<static> component.widgetControls :Object:.<string:, wp.mediaWidgets.MediaWidgetControl:>

Mapping of widget ID to instances of MediaWidgetControl subclasses.
Type:
Source:

Methods


<static> component.handleWidgetAdded(event, widgetContainer)

Handle widget being added or initialized for the first time at the widget-added event.
Parameters:
Name Type Description
event jQuery.Event Event.
widgetContainer jQuery Widget container element.
Source:
Returns:
Type
void

<static> component.handleWidgetUpdated(event, widgetContainer)

Sync widget instance data sanitized from server back onto widget model. This gets called via the 'widget-updated' event when saving a widget from the widgets admin screen and also via the 'widget-synced' event when making a change to a widget in the customizer.
Parameters:
Name Type Description
event jQuery.Event Event.
widgetContainer jQuery Widget container element.
Source:
Returns:
Type
void

<static> component.init()

Initialize functionality. This function exists to prevent the JS file from having to boot itself. When WordPress enqueues this script, it should have an inline script attached which calls wp.mediaWidgets.init().
Source:
Returns:
Type
void

<static> component.setupAccessibleMode()

Setup widget in accessibility mode.
Source:
Returns:
Type
void