image_send_to_editor WordPress Filter Hook

The image_send_to_editor hook allows you to modify the image before it is inserted into the post editor. This is useful for setting custom sizes or adding alignments.

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 ) #

Filters the image HTML markup to send to the editor when inserting an image.


Parameters

$html

(string)The image HTML markup to send.

$id

(int)The attachment ID.

$caption

(string)The image caption.

$title

(string)The image title.

$align

(string)The image alignment.

$url

(string)The image source URL.

$size

(string|int[])Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).

$alt

(string)The image alternative, or alt, text.

$rel

(string)The image rel attribute.


Top ↑

Source

File: wp-admin/includes/media.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.6.0The $rel parameter was added.
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More