wp_get_attachment_image_src


wp_get_attachment_image_src ( $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 fall back to a mime type icon. Default false.
Returns:
  • (array|false) { Array of image data, or boolean false if no image is available. @type string $0 Image source URL. @type int $1 Image width in pixels. @type int $2 Image height in pixels. @type bool $3 Whether the image is a resized image. }
Defined at:

Description

Retrieves an image to represent an attachment.

Related Functions

wp_get_attachment_image_srcset, wp_get_attachment_image_url, wp_get_attachment_image, wp_get_attachment_image_sizes, get_attachment_icon_src

Top Google Results

User discussions

wpseek mobile