[wp-trac] [WordPress Trac] #15614: wp_get_attachment_image functions should check id for an image

WordPress Trac wp-trac at lists.automattic.com
Tue Nov 30 16:14:57 UTC 2010


#15614: wp_get_attachment_image functions should check id for an image
--------------------------+-------------------------------------------------
 Reporter:  mtdewvirus    |       Owner:                  
     Type:  defect (bug)  |      Status:  new             
 Priority:  normal        |   Milestone:  Awaiting Review 
Component:  Media         |     Version:  3.1             
 Severity:  normal        |    Keywords:  attachment,image
--------------------------+-------------------------------------------------

Comment(by mtdewvirus):

 Replying to [comment:2 filosofo]:
 > What are the unexpected results?  `wp_get_attachment_image` calls
 `wp_get_attachment_image_src`, which calls `image_downsize`, and
 `image_downsize` performs that check already.  I don't see how you would
 get anything other than an empty string or `false` already.

 Run it on a video post_id and you get an image returned. If
 `image_downsize` fails in `wp_get_attachment_image_src`, the function
 still tries to get an image by using `wp_mime_type_icon`.

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


More information about the wp-trac mailing list