Uses
Uses | Description |
---|---|
wp-includes/media.php: wp_get_attachment_image_src() | Retrieves an image to represent an attachment. |
Get the URL of an image attachment.
(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
(string|false) Attachment URL or false if no image is available.
File: wp-includes/media.php
function wp_get_attachment_image_url( $attachment_id, $size = 'thumbnail', $icon = false ) { $image = wp_get_attachment_image_src( $attachment_id, $size, $icon ); return isset( $image['0'] ) ? $image['0'] : false; }
Version | Description |
---|---|
4.4.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_get_attachment_image_url