Title: send_to_editor function
Last modified: August 20, 2016

---

# send_to_editor function

 *  [JamiesWright](https://wordpress.org/support/users/jamieswright/)
 * (@jamieswright)
 * [14 years ago](https://wordpress.org/support/topic/send_to_editor-function/)
 * Hi,
    I’m developing a plugin, and one part of the plugin will allow user to insert
   image from the media library using WordPress media-upload. I have been able to
   create one “choose image” field using
 *     ```
       <a class="thickbox" id="3" href="media-upload.php?type=image&TB_iframe=1&width=640&height=500&tab=gallery" title="Set Image">Choose Image</a>
   
       <p id="img1">Image Shown Here</p>
       ```
   
 * and the function
 *     ```
       function send_to_editor(h)
       	{
       		jQuery('#img1').html(h);
       		tb_remove();
       	}
       ```
   
 * The goal is to add a second ‘anchor’ which will output the image to a second ‘
   paragraph’, but I’m unable to find any resources nor ideas for this. I would 
   appreciate it if someone could point me in the right direction.
 * Another part I wish to add is for the send_to_editor function to add the URL 
   to a text input. The ‘anchor’ class is created with Javascript’s createElement
   function in a for loop if that helps. Thanks!

The topic ‘send_to_editor function’ is closed to new replies.

## Tags

 * [image](https://wordpress.org/support/topic-tag/image/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [media library](https://wordpress.org/support/topic-tag/media-library/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [JamiesWright](https://wordpress.org/support/users/jamieswright/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/send_to_editor-function/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
