SHARE
TWEET

Untitled

a guest Apr 7th, 2013 136 Never
  1.         $('.sb-media-btn').click(function() {
  2.             var send_attachment_bkp = wp.media.editor.send.attachment;
  3.             var id = $(this).attr('rel-id');
  4.  
  5.             wp.media.editor.send.attachment = function(props, attachment) {
  6.                 $('#url_' + id).val(attachment.url);
  7.                 wp.media.editor.send.attachment = send_attachment_bkp;
  8.             }
  9.  
  10.             wp.media.editor.open($(this));
  11.  
  12.             return false;      
  13.         });
RAW Paste Data
Top