wp_get_attachment_image_url
wp_get_attachment_image_url ( $attachment_id, $size = 'thumbnail', $icon = false )
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 'thumbnail'.
- (bool) icon Optional. Whether the image should be treated as an icon. Default false.
Returns:- (string|false) Attachment URL or false if no image is available. If `$size` does not match any registered image size, the original image URL will be returned.
Defined at: - Introduced in WordPress: 4.4.0
- Deprecated in WordPress: —
Description
Gets the URL of an image attachment.