A WordPress-centric search engine for devs and theme authors



wp_img_tag_add_srcset_and_sizes_attr ›

Since5.5.0
Deprecatedn/a
apply_filters( 'wp_img_tag_add_srcset_and_sizes_attr', true, $image, $context, $attachment_id )
Parameters: (4)
  • (bool) $value The filtered value, defaults to `true`.
    Required: Yes
  • (string) $image The HTML `img` tag where the attribute should be added.
    Required: Yes
  • (string) $context Additional context about how the function was called or where the img tag is.
    Required: Yes
  • (int) $attachment_id The image attachment ID.
    Required: Yes
Defined at:
Codex:

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.





Source

$add = apply_filters( 'wp_img_tag_add_srcset_and_sizes_attr', true, $image, $context, $attachment_id );