WordPress Hooks Explorer

Listing all hooks extracted WordPress Core


Details about wp_img_tag_add_srcset_and_sizes_attr

Back to home

Files

Filename Hook Type Line Number PHP Doc
wp-includes/media.php apply_filters 2063 /**
* Filters whether to add the `srcset` and `sizes` HTML attributes to the img tag. Default `true`.
*
* Returning anything else than `true` will not add the attributes.
*
* @since 5.5.0
*
* @param bool $value The filtered value, defaults to `true`.
* @param string $image The HTML `img` tag where the attribute should be added.
* @param string $context Additional context about how the function was called or where the img tag is.
* @param int $attachment_id The image attachment ID.
*/

Hook Parameters

Parameter Type Name Description
bool $value The filtered value, defaults to `true`.
string $image The HTML `img` tag where the attribute should be added.
string $context Additional context about how the function was called or where the img tag is.
int $attachment_id The image attachment ID.