Core Function
View Source on Trac ↗ get_image_tag()
get_image_tag( mixed $id, mixed $alt, mixed $title, mixed $align, mixed $size = 'medium' ) Gets an img tag for an image attachment, scaling it down if requested.
Parameters 5 required
| Name / Type | Description |
|---|---|
| $id int | Attachment ID. Required |
| $alt string | Image description for the alt attribute. Required |
| $title string | Image description for the title attribute. Required |
| $align string | Part of the class name for aligning the image. Required |
| mixed | (string | int[]) $size Optional. Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order). Default 'medium'. Required |
Return Value
(string)
HTML IMG element for given image attachment.
Function Information
Since Version
2.5.0
Source File
wp-includes/media.php
Advertisement