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

image_resize, wp_image_editor_supports, image_add_caption, image_get_intermediate_size, wp_ajax_add_menu_item

Top Google Results

User discussions

wpseek mobile