I disabled creation until the post is published because there were problems when a post was auto-saved as a draft. There might be a pretty easy solution though, look for this block of code:
// Find video thumbnail when saving a post, but not on autosave
add_action('new_to_publish', 'save_video_thumbnail', 10, 1);
add_action('draft_to_publish', 'save_video_thumbnail', 10, 1);
add_action('pending_to_publish', 'save_video_thumbnail', 10, 1);
add_action('future_to_publish', 'save_video_thumbnail', 10, 1);
and immediately after add this:
// Save with draft
add_action('save_post', 'save_draft_video_thumbnail', 10, 1);
function save_draft_video_thumbnail($post_id) {
$postdata = get_postdata($post_id);
if ($postdata['post_status'] == 'draft') {
get_video_thumbnail( $post_id );
}
}
Give it a shot and let me know if and how it works! Depending on the results I may add a setting to save a thumbnail with drafts.
It works!
Can’t thank you enough for this plugin.
marc