new media_audio()
Audio widget model.
See WP_Widget_Audio::enqueue_admin_scripts() for amending prototype from PHP exports.
Extends
Members
-
idAttribute :string
-
Id attribute.
Type:
- string
- Inherited From:
- Source:
-
schema :Object:.<string:, Object:>
-
Instance schema. This adheres to JSON Schema and subclasses should have their schema exported from PHP to JS such as is done in WP_Widget_Media_Image::enqueue_admin_scripts().
Type:
- Inherited From:
- Source:
Methods
-
defaults()
-
Get default attribute values.
- Inherited From:
- Source:
Returns:
Mapping of property names to their default values.- Type
- Object
-
getEmbedResetProps()
-
Get props which are merged on top of the model when an embed is chosen (as opposed to an attachment).
- Inherited From:
- Source:
Returns:
Reset/override props.- Type
- Object
-
set(key [, val] [, options])
-
Set attribute value(s). This is a wrapped version of Backbone.Model#set() which allows us to cast the attribute values from the hidden inputs' string values into the appropriate data types (integers or booleans).
Parameters:
Name Type Argument Description key
string | Object Attribute name or attribute pairs. val
mixed | Object <optional>
Attribute value or options object. options
Object <optional>
Options when attribute name and value are passed separately. - Inherited From:
- Source:
Returns:
This model.