Set the post ID when calling wp_get_attachment_url(). Props chess64. fixes #4104

git-svn-id: http://svn.automattic.com/wordpress/trunk@5199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n 2007-04-06 23:42:38 +00:00
parent d82463f788
commit 4a4d37f9f3

View File

@ -345,7 +345,7 @@ function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false)
$id = (int) $id; $id = (int) $id;
$_post = & get_post($id); $_post = & get_post($id);
if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url() ) if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )
return __('Missing Attachment'); return __('Missing Attachment');
$post_title = attribute_escape($_post->post_title); $post_title = attribute_escape($_post->post_title);