WP 4.9 media upload issue on insert to post

wordpress

#1

Hi,

Anyone experiencing this issue? My metabox upload field suddenly not working on latest WordPress version. It has a conflict on “Add Media” insert to post button. I used this code snippet below. It works fine on older WordPress version.

jQuery(document).ready(function() {
 
jQuery('#upload_image_button').click(function() {
 tb_show('', 'media-upload.php?type=image&TB_iframe=true');
 return false;
});
 
window.send_to_editor = function(html) {
 var imgurl = jQuery('img',html).attr('src');
 jQuery('#upload_image').val(imgurl);
 tb_remove();
}
 
});

Thanks for the help!