wp_get_attachment_image_url


wp_get_attachment_image_url ( $attachment_id, $size = 'thumbnail', $icon = false )

Parameters:
  • (int) $attachment_id Image attachment ID.
  • (string|array) $size Optional. Image size to retrieve. Accepts any valid image size, 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.
Defined at:

Description

Get the URL of an image attachment.

Related Functions

wp_get_attachment_image_src, wp_get_attachment_image, wp_get_attachment_image_srcset, wp_get_attachment_url, wp_get_attachment_image_sizes

Top Google Results

User discussions

wpseek mobile