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:

Description

Gets the URL of an image attachment.

Related Functions

wp_get_attachment_image_src, wp_get_attachment_image, wp_get_attachment_url, wp_get_attachment_image_srcset, wp_get_attachment_image_sizes

Top Google Results

User discussions

wpseek mobile