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

---

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

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/get_image_tag/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/get_image_tag/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/get_image_tag/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/get_image_tag/?output_format=md#changelog)

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

Filters the HTML content for the image tag.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/get_image_tag/?output_format=md#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).

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

    ```php
    return apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );
    ```

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

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

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

Gets an img tag for an image attachment, scaling it down if requested.

  |

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

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

## User Contributed Notes

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