wp_get_attachment_image_srcset
wp_get_attachment_image_srcset ( $attachment_id, $size = 'medium', $image_meta = null )
Parameters:- (int) attachment_id Image attachment ID.
- (string|int[]) size Optional. Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order). Default 'medium'.
- (array|null) image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. Default null.
See:Returns:- (string|false) A 'srcset' value string or false.
Defined at: - Introduced in WordPress: 4.4.0
- Deprecated in WordPress: —
Description
Retrieves the value for an image attachment's 'srcset' attribute.