get_image_tag WordPress Filter Hook

The get_image_tag hook is used to filter the image tag before it is outputted to the screen. This hook is useful for making changes to the image tag before it is displayed on the front end of the website.

apply_filters( 'get_image_tag', string $html, int $id, string $alt, string $title, string $align, string|int[] $size ) #

Filters the HTML content for the image tag.


Parameters

$html

(string)HTML content for the image.

$id

(int)Attachment ID.

$alt

(string)Image description for the alt attribute.

$title

(string)Image description for the title attribute.

$align

(string)Part of the class name for aligning the image.

$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).


Top ↑

Source

File: wp-includes/media.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.6.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