Make WordPress Core

Ticket #12306: post.php.diff

File post.php.diff, 638 bytes (added by jfarthing84, 15 years ago)

This is the first method of using a filter on the 'attachment_types'

  • post.php

     
    34053405
    34063406        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.
    34073407                $url = get_the_guid( $post->ID );
     3408               
     3409        $attachment_types = apply_filters('attachment_types', array('attachment'));
    34083410
    3409         if ( 'attachment' != $post->post_type || empty($url) )
     3411        if ( in_array($post->post_type, $attachment_types) || empty($url) )
    34103412                return false;
    34113413
    34123414        return apply_filters( 'wp_get_attachment_url', $url, $post->ID );