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_image_src_get_dimensions, image_resize, wp_get_active_and_valid_themes, wp_img_tag_add_width_and_height_attr

Top Google Results

User discussions

wpseek mobile