Hi Sutherland,
I think you should use the code below
empty(get_the_post_thumbnail( $post_id ))
instead of
!get_post_thumbnail_id( $post_id )`
seems WP did not delete “_thumbnail_id” from the post when we delete the image from the media library.
Incidentally, another problem:
when we publish a post, we can’t get video thumbnail from extra “Theme Post Settings”, although we used custom fields to stored the extra post settings and already add filter to “video_thumbnail_markup” . We have to publish it first, then search again manually. I think the root of the problem is we couldn’t get the value of the custom field before it be published.
if we use WordPress built-in “Custom Fields” meta box to add custom field, it’s working. But you know, most themes used custom settings panel.
I noticed that you add_action “save_video_thumbnail” to six “{older_status}_to_{new_status}” , but almost all themes handle data via “save_post” action, so I think you may need to add_action to ‘save_post’, add set $priority to a high number like this
add_action( 'save_post', array( &$this, 'save_video_thumbnail' ), 9999999, 1 );
However, this is a great plugin, and looking forward your new version.