• Resolved werdcom

    (@werdcom)


    Hi, I’d like to create the thumbnail when saving as a draft as I need to clean it up a bit first before publishing live. I looked through the plugin code and couldn’t find what to edit.

    thank you!

    marc

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    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.

    Thread Starter werdcom

    (@werdcom)

    It works!

    Can’t thank you enough for this plugin.

    marc

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Video Thumbnails] Create thumbnail when saving DRAFT’ is closed to new replies.