WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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?

share|improve this answer
Thanks dunc, this answer part of my question! I know how to remove elements from media uploaded now. Thanks :) – DeryckOE Apr 1 '12 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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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