Core Function
View Source on Trac ↗ wp_get_attachment_image_sizes()
wp_get_attachment_image_sizes( mixed $attachment_id, mixed $size = 'medium', mixed $image_meta = null ) Retrieves the value for an image attachment's 'sizes' attribute.
Parameters 3 required
| Name / Type | Description |
|---|---|
| $attachment_id int | Image attachment ID. Required |
| mixed | (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'. Required |
| mixed | (array | null) $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. Default null. Required |
Return Value
((string)
| false) A valid source size value for use in a 'sizes' attribute or false.
Function Information
Since Version
4.4.0
Source File
wp-includes/media.php
Advertisement