$id =
(int) $id;
$_post =
get_post($id);
if ( ('attachment' !=
$_post->post_type
) || !
$url =
wp_get_attachment_url($_post->ID
) ) return __('Missing Attachment'
);
if ( $permalink ) $url =
get_attachment_link($_post->ID
);
$post_title =
esc_attr($_post->post_title
);
$innerHTML =
get_attachment_innerHTML($_post->ID,
$fullsize,
$max_dims);
return "<a href='
$url' title='
$post_title'>
$innerHTML</a>";
}/**
* Retrieve icon URL and Path.
*
* @since 2.1.0
* @deprecated 2.5.0 Use wp_get_attachment_image_src()
* @see wp_get_attachment_image_src()
*
* @param int $id Optional. Post ID.
* @param bool $fullsize Optional. Whether to have full image. Default false.
* @return array Icon URL and full path to file, respectively.
*/