wp_get_attachment_image_sizes( int $attachment_id, array|string $size = 'medium', array $image_meta = null )
Retrieves the value for an image attachment’s ‘sizes’ attribute.
Description
See also
Parameters
- $attachment_id
-
(Required) Image attachment ID.
- $size
-
(Optional) Image size. Accepts any valid image size, or an array of width and height values in pixels (in that order). Default 'medium'.
Default value: 'medium'
- $image_meta
-
(Optional) The image meta data as returned by 'wp_get_attachment_metadata()'.
Default value: null
Return
(string|bool) A valid source size value for use in a 'sizes' attribute or false.
Source
File: wp-includes/media.php
Changelog
Version | Description |
---|---|
WP-4.4.0 | Introduced. |