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:

Description

Retrieves the value for an image attachment's 'srcset' attribute.

Related Functions

wp_get_attachment_image_src, wp_get_attachment_image_sizes, wp_get_attachment_image_url, wp_get_attachment_image, get_attachment_icon_src

Top Google Results

User discussions

wpseek mobile