apply_filters( 'image_send_to_editor', string $html, int $id, string $caption, string $title, string $align, string $url, string|int[] $size, string $alt, string $rel )
- Since
- 2.5.0, 5.6.0
Filters the image HTML markup to send to the editor when inserting an image.
Compatibility
- WordPress
- since 5.6.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$htmlstring- The image HTML markup to send.
$idint- The attachment ID.
$captionstring- The image caption.
$titlestring- The image title.
$alignstring- The image alignment.
$urlstring- The image source URL.
$sizestring|int[]- Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
$altstring- The image alternative, or alt, text.
$relstring- The image rel attribute.
Where this hook fires · 1
wp-admin/includes/media.php:168get_image_send_to_editor()
Source code
* @param string $url The image source URL. * @param string|int[] $size Requested image size. Can be any registered image size name, or * an array of width and height values in pixels (in that order). * @param string $alt The image alternative, or alt, text. * @param string $rel The image rel attribute. */ $html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt, $rel ); return $html;} /** * Adds image shortcode with caption to editor.Changelog
Introduced in 2.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
5.6.0
The
$rel parameter was added.from the docblock2.5.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.