Title: media_send_to_editor
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘media_send_to_editor’, string $html, int $send_id, array $attachment )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#wp--skip-link--target)

Filters the HTML markup for a media item sent to the editor.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#description)󠁿

### 󠀁[See also](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#see-also)󠁿

 * [wp_get_attachment_metadata()](https://developer.wordpress.org/reference/functions/wp_get_attachment_metadata/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#parameters)󠁿

 `$html`string

HTML markup for a media item sent to the editor.

`$send_id`int

The first key from the $_POST[`'send'`] data.

`$attachment`array

Array of attachment metadata.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#source)󠁿

    ```php
    $html = apply_filters( 'media_send_to_editor', $html, $send_id, $attachment );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/media.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/media.php#L875)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/media.php#L875-L875)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#related)󠁿

| Used by | Description | 
| [media_upload_form_handler()](https://developer.wordpress.org/reference/functions/media_upload_form_handler/)`wp-admin/includes/media.php` |

Handles form submissions for the legacy media uploader.

  | 
| [wp_ajax_send_attachment_to_editor()](https://developer.wordpress.org/reference/functions/wp_ajax_send_attachment_to_editor/)`wp-admin/includes/ajax-actions.php` |

Handles sending an attachment to the editor via AJAX.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/media_send_to_editor/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fmedia_send_to_editor%2F)
before being able to contribute a note or feedback.