WordPress.org

Make WordPress Core

Ticket #15494: fix-unimaginative-attachment-url-filter.15494.diff

File fix-unimaginative-attachment-url-filter.15494.diff, 673 bytes (added by filosofo, 10 years ago)
  • wp-includes/post.php

     
    38223822        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.
    38233823                $url = get_the_guid( $post->ID );
    38243824
    3825         if ( 'attachment' != $post->post_type || empty($url) )
     3825        $url = apply_filters( 'wp_get_attachment_url', $url, $post->ID );
     3826
     3827        if ( 'attachment' != $post->post_type || empty( $url ) )
    38263828                return false;
    3827 
    3828         return apply_filters( 'wp_get_attachment_url', $url, $post->ID );
     3829       
     3830        return $url;
    38293831}
    38303832
    38313833/**