This plugin adds the possibility to open WordPress's media iframe and returns the attached media.
To get going with the plugin you can:
- Download the latest release
- Install with Bower:
bower install jquery-wp-media
$('.nw_ncs_set_post_pdf_url').nw_add_media({
trigger: "click",
title: "Insert Media",
button_text: "Insert into page",
functionAfter: function(attachment) {
console.log(attachment);
}
});
type: String / default: click
Which event shpuld triger the WordPress media popup to open.
type: String / default: Insert Media
The title of the WordPress media popup.
type: String / default: Insert into page
The button text of the WordPress media popup.
type: Function / default: null
/ return: object
The callback function that returns the attachement object.