Summery Summery
Get the URL of an image attachment.
Syntax Syntax
Parameters Parameters
- $attachment_id
-
(Required) Image attachment ID.
- $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'.
Default value: 'thumbnail'
- $icon
-
(Optional) Whether the image should be treated as an icon.
Default value: false
Return Return
(string|false) Attachment URL or false if no image is available.
Source Source
File: wp-includes/media.php
$attr = array_map( 'esc_attr', $attr ); $html = rtrim( "<img $hwstring" );
Advertisement
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |