Apply wp_get_attachment_url to empty urls. Props filosofo. fixes #15494

git-svn-id: http://svn.automattic.com/wordpress/trunk@16768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-12-07 18:16:21 +00:00
parent d5f81d06f9
commit 5ce0d9cb7a
1 changed files with 5 additions and 3 deletions

View File

@ -3831,10 +3831,12 @@ function wp_get_attachment_url( $post_id = 0 ) {
if ( empty($url) ) //If any of the above options failed, Fallback on the GUID as used pre-2.7, not recomended to rely upon this.
$url = get_the_guid( $post->ID );
if ( 'attachment' != $post->post_type || empty($url) )
return false;
$url = apply_filters( 'wp_get_attachment_url', $url, $post->ID );
return apply_filters( 'wp_get_attachment_url', $url, $post->ID );
if ( 'attachment' != $post->post_type || empty( $url ) )
return false;
return $url;
}
/**