WordPress.org

Make WordPress Core

Ticket #20948: post.php.patch

File post.php.patch, 520 bytes (added by jfarthing84, 23 months ago)

Remove post type check from wp_get_attachment_url.

  • wp-includes/post.php

     
    39403940        if ( !$post =& get_post( $post_id ) ) 
    39413941                return false; 
    39423942 
    3943         if ( 'attachment' != $post->post_type ) 
    3944                 return false; 
    3945  
    39463943        $url = ''; 
    39473944        if ( $file = get_post_meta( $post->ID, '_wp_attached_file', true) ) { //Get attached file 
    39483945                if ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) { //Get upload directory