apply_filters( 'get_image_tag_class', string $class , int $id , string $align , string|int[] $size )
Filters the value of the attachment’s image tag class attribute.
Parameters
-
$class
string -
CSS class name or space-separated list of classes.
-
$id
int -
Attachment ID.
-
$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
File: wp-includes/media.php
.
View all references
$class = apply_filters( 'get_image_tag_class', $class, $id, $align, $size );
Changelog
Version | Description |
---|---|
2.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
To add the .img-fluid class, for responsive images in Bootstrap 4:
Top ↑
Feedback
It will not work for the_post_thumbnail(); It will work only for what you have in wysiwyg editor — By Kris Kelvin —