Sindbad~EG File Manager
/*
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery('.st_upload_button').click(function() {
targetfield = jQuery(this).prev('.upload-url');
tb_show('', 'media-upload.php?type=image&TB_iframe=true');
return false;
});
window.send_to_editor = function(html) {
imgurl = jQuery('img',html).attr('src');
jQuery(targetfield).val(imgurl);
tb_remove();
}
});
*/
(function($){
$(document).ready(function($){
$('.st_upload_button').click(function(e) {
var $el = $(this).parent();
e.preventDefault();
var uploader = wp.media({
title : 'Media upload',
multiple : false,
})
.on('select', function(){
var selection = uploader.state().get('selection');
var attachment = selection.first().toJSON();
$('input.upload-url', $el).val(attachment.url);
})
.open();
})
});
})(jQuery);
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists