[wp-trac] [WordPress Trac] #18855: get_attached_file( $post_id ) wrongly(?) returns the uploads directory when $post_id is not a valid attachment

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 8 19:06:46 UTC 2011


#18855: get_attached_file( $post_id ) wrongly(?) returns the uploads directory when
$post_id is not a valid attachment
------------------------------------+------------------------------
 Reporter:  mikeschinkel            |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Post Thumbnails         |     Version:  3.2.1
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------------------

Comment (by gandham):

 This function uses get_post_meta and some images meta data does not
 include '''_wp_attached_file''' , in this case also get_attached_file is
 returning the incorrect path.
 {{{
         $file = get_post_meta( $attachment_id, '_wp_attached_file', true
 );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18855#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list