Skip to content

Instantly share code, notes, and snippets.

@staylor
Created January 29, 2014 18:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staylor/10115a0f455e16c6eafd to your computer and use it in GitHub Desktop.
Save staylor/10115a0f455e16c6eafd to your computer and use it in GitHub Desktop.
wp.media {
string {
/**
* Joins the `props` and `attachment` objects,
* outputting the proper object format based on the
* attachment's type.
*/
props : function () {},
/**
* Create link markup that is suitable for passing to the editor
*/
link : function () {},
/**
* Create image markup, optionally with a link and/or wrapped in a caption shortcode,
* that is suitable for passing to the editor
*/
image : function () {},
/**
* Create an Audio shortcode string that is suitable for passing to the editor
*/
audio : function () {},
/**
* Create a Video shortcode string that is suitable for passing to the editor
*/
video : function () {},
/**
* Helper function to create a media shortcode string
*/
_audioVideo : function () {}
}
gallery {
/**
* Default gallery properties
*/
defaults : {},
/**
* Retrieve attachments based on the properties of the passed shortcode
*/
attachments : function () {},
/**
* Triggered when clicking 'Insert Gallery' or 'Update Gallery'
*/
shortcode : function () {},
/**
* Triggered when double-clicking a Gallery shortcode placeholder
* in the editor
*/
edit : function () {}
}
featuredImage {
/**
* Get the featured image post ID
*/
get : function () {},
/**
* Set the featured image id, save the post thumbnail data and
* set the HTML in the post meta box to the new featured image.
*/
set : function () {},
/**
* The Featured Image workflow
*/
frame : function () {},
/**
* 'select' callback for Featured Image workflow, triggered when
* the 'Set Featured Image' button is clicked in the media modal.
*/
select : function () {},
/**
* Open the content media manager to the 'featured image' tab when
* the post thumbnail is clicked.
*/
init : function () {},
}
editor {
/**
* Send content to the editor
*/
insert : function () {},
/**
* Setup 'workflow' and add to the 'workflows' cache. 'open' can
* subsequently be called upon it.
*/
add : function () {},
/**
* Determines the proper current workflow id
*/
id : function () {},
/**
* Return the workflow specified by id
*/
get : function () {},
/**
* Remove the workflow represented by id from the workflow cache
*/
remove : function () {},
/**
* Open a workflow
*/
open : function () {},
/**
* Bind click event for .insert-media using event delegation
*/
init : function () {},
send : {
/**
* Called when sending an attachment to the editor
* from the medial modal.
*/
attachment : function () {},
/**
* Called when 'Insert From URL' source is not an image. Example: YouTube url.
*/
link : function () {},
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment