I'm using the following code for upload in multiple mextaboxes in a post or page admin section. Works for metaboxes but breaks the TinyMCE insert image. I want to know please how I can achieve this without breaking the TinyMCE. Off course the issue comes when I overwrite the windows.send_to_editor function.

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');

A possible solution would be hiding "Insert into post" button which by the way is not to semantic in the metaboxes and put a new button like "Select image" and writing a function with take the img o attach url a assign to the input. How can I do that o something else you recommend?

Thanks in advance.


2 Answers 2


I was looking at this answer earlier. It shows you how to remove fields from the Media Uploader, so maybe it'll set you on the right lines for writing an additional function to incorporate into the Uploader?

  • Thanks dunc, this answer part of my question! I know how to remove elements from media uploaded now. Thanks :)
    – DeryckOE
    Commented Apr 1, 2012 at 15:42

problem is you are overwriting send_to_editor() function. I have a similar question answered by bainternet. Never had time to test it out. Let me know if it works for you. How to handle multiple instance of "send_to_editor" js function

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.