wp_img_tag_add_srcset_and_sizes_attr


wp_img_tag_add_srcset_and_sizes_attr ( $image, $context, $attachment_id )

Parameters:
  • (string) image The HTML `img` tag where the attribute should be added.
  • (string) context Additional context to pass to the filters.
  • (int) attachment_id Image attachment ID.
Returns:
  • (string) Converted 'img' element with 'loading' attribute added.
Defined at:

Description

Adds `srcset` and `sizes` attributes to an existing `img` HTML tag.

Related Functions

wp_image_add_srcset_and_sizes, wp_img_tag_add_loading_attr, wp_image_matches_ratio, wp_ajax_send_link_to_editor, wp_parse_id_list

Top Google Results

User discussions

wpseek mobile