new media_audio()
Audio widget control.
See WP_Widget_Audio::enqueue_admin_scripts() for amending prototype from PHP exports.
Extends
Members
-
events :Object
-
View events.
Type:
- Object
- Inherited From:
- Overrides:
- Source:
-
id_base :string
-
Widget ID base. This may be defined by the subclass. It may be exported from PHP to JS such as is done in WP_Widget_Media_Image::enqueue_admin_scripts(). If not, it will attempt to be discovered by looking to see if this control instance extends each member of component.controlConstructors, and if it does extend one, will use the key as the id_base.
Type:
- string
- Inherited From:
- Overrides:
- Source:
-
l10n :Object
-
Translation strings. The mapping of translation strings is handled by media widget subclasses, exported from PHP to JS such as is done in WP_Widget_Media_Image::enqueue_admin_scripts().
Type:
- Object
- Inherited From:
- Overrides:
- Source:
-
mime_type :string
-
Mime type. This must be defined by the subclass. It may be exported from PHP to JS such as is done in WP_Widget_Media_Image::enqueue_admin_scripts().
Type:
- string
- Inherited From:
- Overrides:
- Source:
-
showDisplaySettings :boolean
-
Show display settings.
Type:
- boolean
Methods
-
editMedia()
-
Open the media audio-edit frame to modify the selected item.
- Overrides:
- Source:
Returns:
- Type
- void
-
getModelPropsFromMediaFrame(mediaFrame)
-
Get the instance props from the media selection frame.
Parameters:
Name Type Description mediaFrame
wp.media.view.MediaFrame.Select Select frame. - Inherited From:
- Overrides:
- Source:
Returns:
Props.- Type
- Object
-
handleMediaLibraryLinkClick(event)
-
Handle click on link to Media Library to open modal, such as the link that appears when in the missing attachment error notice.
Parameters:
Name Type Description event
jQuery.Event Event. - Inherited From:
- Overrides:
- Source:
Returns:
- Type
- void
-
isSelected()
-
Whether a media item is selected.
- Inherited From:
- Overrides:
- Source:
Returns:
Whether selected and no error.- Type
- boolean
-
mapMediaToModelProps(mediaFrameProps)
-
Map media frame props to model props.
Parameters:
Name Type Description mediaFrameProps
Object Media frame props. - Inherited From:
- Overrides:
- Source:
Returns:
Model props.- Type
- Object
-
mapModelToMediaFrameProps(modelProps)
-
Map model props to media frame props.
Parameters:
Name Type Description modelProps
Object Model props. - Overrides:
- Source:
Returns:
Media frame props.- Type
- Object
-
mapModelToPreviewTemplateProps()
-
Map model props to previewTemplateProps.
- Inherited From:
- Overrides:
- Source:
Returns:
Preview Template Props.- Type
- Object
-
render()
-
Render template.
- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- void
-
renderPreview()
-
Render preview.
- Overrides:
- Source:
Returns:
- Type
- void
-
selectMedia()
-
Open the media select frame to chose an item.
- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- void
-
syncModelToInputs()
-
Sync the model attributes to the hidden inputs, and update previewTemplateProps.
- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- void
-
syncModelToPreviewProps()
-
Sync the model attributes to the hidden inputs, and update previewTemplateProps.
- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- void
-
template()
-
Get template.
- Inherited From:
- Overrides:
- Source:
Returns:
Template.- Type
- function
-
updateSelectedAttachment()
-
Update the selected attachment if necessary.
- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- void