I have this part of code which loads custom version of jquery
wp_deregister_script('jquery');
wp_register_script('jquery', ("http://code.jquery.com/jquery-latest.min.js"), false, '');
wp_enqueue_script('jquery');
Everything works fine but if i open the media upload manager which is loaded by this code
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
and triggered by this
<script language="JavaScript">
jQuery(document).ready(function() {
jQuery('#upload_image_button').click(function() {
formfield = jQuery('#upload_image').attr('name');
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('#upload_image').val(imgurl);
tb_remove();
}
});
</script>
<label for="upload_image">
<input id="upload_image" type="text" size="36" name="upload_image" value="<?php ?>" />
<input id="upload_image_button" type="button" value="Upload Image" />
<br />Enter an URL or upload an image for the banner.
</label>
The lightbox opens and displays all options, but when i choose "Upload Image" or if i go to media library and select an image from there nothing happens.
If i remove the custom jquery the media uploader works fine. But then the jquery ui code i have is not working, although i am loading the jquery-ui script, so i have to load my custom latest version of jquery.
Is there any solution so both media-upload and jquery-ui are working on the same page in the plugins admin panel?