Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.sb-media-btn').click(function() {
- var send_attachment_bkp = wp.media.editor.send.attachment;
- var id = $(this).attr('rel-id');
- wp.media.editor.send.attachment = function(props, attachment) {
- $('#url_' + id).val(attachment.url);
- wp.media.editor.send.attachment = send_attachment_bkp;
- }
- wp.media.editor.open($(this));
- return false;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement