wp_image_add_srcset_and_sizes


wp_image_add_srcset_and_sizes ( $image, $image_meta, $attachment_id )

Parameters:
  • (string) image An HTML 'img' element to be filtered.
  • (array) image_meta The image meta data as returned by 'wp_get_attachment_metadata()'.
  • (int) attachment_id Image attachment ID.
See:
Returns:
  • (string) Converted 'img' element with 'srcset' and 'sizes' attributes added.
Defined at:

Description

Adds 'srcset' and 'sizes' attributes to an existing 'img' element.

Related Functions

wp_img_tag_add_srcset_and_sizes_attr, wp_img_tag_add_auto_sizes, wp_image_src_get_dimensions, image_resize, wp_get_active_and_valid_themes

Top Google Results

User discussions

wpseek mobile