From 2e64f813ecc6c23047cec3bf585cebb576646d83 Mon Sep 17 00:00:00 2001 From: rob1n Date: Fri, 6 Apr 2007 23:42:38 +0000 Subject: [PATCH] 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 --- wp-includes/post-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 94d2876193..358ebc9808 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -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);