Ticket #17579: 17579.diff
File 17579.diff, 642 bytes (added by , 13 years ago) |
---|
-
wp-includes/post.php
3839 3839 */ 3840 3840 function wp_get_attachment_url( $post_id = 0 ) { 3841 3841 $post_id = (int) $post_id; 3842 if ( !$post =& get_post( $post_id ) )3842 if ( !$post =& get_post( $post_id ) || 'attachment' != $post->post_type ) 3843 3843 return false; 3844 3844 3845 3845 $url = ''; … … 3859 3859 3860 3860 $url = apply_filters( 'wp_get_attachment_url', $url, $post->ID ); 3861 3861 3862 if ( 'attachment' != $post->post_type ||empty( $url ) )3862 if ( empty( $url ) ) 3863 3863 return false; 3864 3864 3865 3865 return $url;