wp_get_attachment_image_url( int $attachment_id, string|array $size = 'thumbnail', bool $icon = false )

Get the URL of an image attachment.

6 related functions found for: wp_get_attachment_image_url

Top ↑

Related terms found for this post

wp-parser-related-wordsattach, attachment, attachments, get, imag, image, images, locat, location, media-php, post-typ, post-type, url, wp-get, wp-includes
wp-parser-packageMedia, WordPress

Top ↑

Terms Used Terms Used

Terms used in the related posts query

  • attach
  • attachment
  • attachments
  • get
  • imag
  • image
  • images
  • locat
  • location
  • Media
  • media-php
  • post-typ
  • post-type
  • url
  • wp-get
  • wp-includes
  • wp-includes/media.php
  • media

Top ↑

Description Description

Top ↑

Parameters Parameters


(int) (Required) Image attachment ID.


(string|array) (Optional) Image size to retrieve. Accepts any valid image size, or an array of width and height values in pixels (in that order).

Default value: 'thumbnail'


(bool) (Optional) Whether the image should be treated as an icon.

Default value: false

Top ↑

Return Return

(string|false) Attachment URL or false if no image is available.

Top ↑

Source Source

File: wp-includes/media.php


Top ↑

Changelog Changelog

Version Description
4.4.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.