Set the post ID when calling wp_get_attachment_url(). Props chess64. fixes #4104
git-svn-id: https://develop.svn.wordpress.org/trunk@5199 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
00cabf391f
commit
2e64f813ec
@ -345,7 +345,7 @@ function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false)
|
||||
$id = (int) $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');
|
||||
|
||||
$post_title = attribute_escape($_post->post_title);
|
||||
|
Loading…
Reference in New Issue
Block a user