jQuery(document).ready(function(n){var t,d,r;t=".custom_media_button",d=!0,r=wp.media.editor.send.attachment,n("body").on("click",t,function(a){var i="#"+n(this).attr("id"),t=(n(i),wp.media.editor.send.attachment,n(i));return t.attr("id").replace("_button",""),d=!0,wp.media.editor.send.attachment=function(t,e){if(!d)return r.apply(i,[t,e]);n(a.target).siblings(".custom_media_url").val(e.url)},wp.media.editor.open(t),!1})});