2020-05-01 / 5905阅 / 悠然
Gets an img tag for an image attachment, scaling it down if requested.
The ‘get_image_tag_class’ filter allows for changing the class name for the image without having to use regular expressions>‘get_image_tag’, has the HTML content, which can then be further manipulated by a plugin to change all attribute values and even HTML content.
(int)
(Required)
Attachment ID.
(string)
(Required)
Image description for the alt attribute.
(string)
(Required)
Image description for the title attribute.
(string)
(Required)
Part of the class name for aligning the image.
(string|array)
(Optional)
Registered image size to retrieve a tag for. Accepts any valid image size, or an array of width and height values in pixels (in that order).
Default value: 'medium'
(string) HTML IMG element for given image attachment