[wp-trac] [WordPress Trac] #11149: Post thumbnail remains after image is trashed

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 16 04:44:11 UTC 2009


#11149: Post thumbnail remains after image is trashed
--------------------------+-------------------------------------------------
 Reporter:  aldenta       |       Owner:             
     Type:  defect (bug)  |      Status:  new        
 Priority:  normal        |   Milestone:  2.9        
Component:  Media         |     Version:  2.9        
 Severity:  normal        |    Keywords:  2nd-opinion
--------------------------+-------------------------------------------------
 If a post thumbnail is assigned, and then the image is trashed, the post
 thumbnail still appears since the _thumbnail_id meta key exists.

 I see a couple of different ideas that might provide a solution. I'm happy
 to write the patch but I need some direction on the best option.

 1. Update get_post_image_id() in post-image-template.php to check if the
 image has been trashed before returning the id. This adds a little bit of
 extra overhead but would keep the post thumbnail in place if they restore
 the image. One possible downside is that if the user later restores the
 image from the Media page then they may be surprised that the post
 thumbnail has also returned.

 2. Delete the _thumbnail_id when the photo is trashed. This would mean
 that if the user clicks Undo then the photo thumbnail is no longer
 attached. It may be nice to delete the _thumbnail_id when a photo is
 deleted anyway to keep the table a little more tidy.

 Any thoughts on the best approach to this?

 Thanks.

 John

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11149>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list