wp_get_attachment_image_srcset( int $attachment_id, array|string $size = 'medium', array $image_meta = null )

Retrieves the value for an image attachment’s ‘srcset’ attribute.

21 related functions found for: wp_get_attachment_image_srcset

Top ↑

Related terms found for this post

wp-parser-related-wordsattach, attachment, attachments, get, imag, image, images, media-php, post-typ, post-type, srcset, wp-get, wp-includes
wp-parser-packageMedia, WordPress

Top ↑

Terms Used Terms Used

Terms used in the related posts query

  • attach
  • attachment
  • attachments
  • get
  • imag
  • image
  • images
  • Media
  • media-php
  • post-typ
  • post-type
  • srcset
  • wp-get
  • wp-includes
  • wp-includes/media.php
  • media

Top ↑

Description Description

Top ↑

Parameters Parameters


(int) (Required) Image attachment ID.


(array|string) (Optional) Image size. Accepts any valid image size, or an array of width and height values in pixels (in that order).

Default value: 'medium'


(array) (Optional) The image meta data as returned by 'wp_get_attachment_metadata()'.

Default value: null

Top ↑

Return Return

(string|bool) A 'srcset' value string or false.

Top ↑

Source Source

File: wp-includes/media.php


Top ↑

Changelog Changelog

Version Description
4.4.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.