Namespace: string

wp.media. string

Methods


<static> audio(props, attachment)

Create an Audio shortcode string that is suitable for passing to the editor
Parameters:
Name Type Description
props Object Attachment details (align, link, size, etc).
attachment Object The attachment object, media version of Post.
Source:
Returns:
The audio shortcode
Type
string

<static> image(props, attachment)

Create image markup, optionally with a link and/or wrapped in a caption shortcode, that is suitable for passing to the editor
Parameters:
Name Type Description
props Object Attachment details (align, link, size, etc).
attachment Object The attachment object, media version of Post.
Source:
Returns:
Type
string

Create link markup that is suitable for passing to the editor
Parameters:
Name Type Description
props Object Attachment details (align, link, size, etc).
attachment Object The attachment object, media version of Post.
Source:
Returns:
The link markup
Type
string

<static> props( [props], attachment)

Joins the `props` and `attachment` objects, outputting the proper object format based on the attachment's type.
Parameters:
Name Type Argument Default Description
props Object <optional>
{} Attachment details (align, link, size, etc).
attachment Object The attachment object, media version of Post.
Source:
Returns:
Joined props
Type
Object

<static> video(props, attachment)

Create a Video shortcode string that is suitable for passing to the editor
Parameters:
Name Type Description
props Object Attachment details (align, link, size, etc).
attachment Object The attachment object, media version of Post.
Source:
Returns:
The video shortcode
Type
string