﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
11149	Images are still visible if trashed or if their parent post is unpublished	aldenta	aldenta	"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"	defect (bug)	closed	normal	2.9	Media	2.9	blocker	fixed	2nd-opinion	
