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: - Introduced in WordPress: 4.4.0
- Deprecated in WordPress: —
Description
Adds 'srcset' and 'sizes' attributes to an existing 'img' element.