Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_get_attachment_image_url ›

Da4.4.0
Deprecaton/a
wp_get_attachment_image_url ( $attachment_id, $size = 'thumbnail', $icon = false )
Parametri: (3)
  • (int) $attachment_id Image attachment ID.
    Richiesto:
  • (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'.
    Richiesto: No
    Default: 'thumbnail'
  • (bool) $icon Optional. Whether the image should be treated as an icon. Default false.
    Richiesto: No
    Default: false
Ritorna:
  • (string|false) Attachment URL or false if no image is available.
Definito a:
Codex:

Get the URL of an image attachment.



Sorgenti

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;
}