• Resolved 12southmusic

    (@12southmusic)


    I noticed this recently when using the most updated version of the plugin (2.5.3)

    Generally, if a Video Thumbnail is edited on Vimeo / Youtube, we can go inside the content item in WordPress, click “Reset Video Thumbnail”, click update, and we’re all good to go.

    Now, it seems that, while it’s updating the “_video_thumbnail” parameter in the database, it is not updating the “_thumbnail_id” for the post, which many plugins and themes use to decide the Featured Image.

    The initial creation of the post writes the “_thumbnail_id” and file to the Media Library without issue, we’re just not seeing the ID update on Reset.

    Is there a quick fix to this? Does this perhaps happen differently in the Pro version?

    Let me know if you could as we’re looking to use this plugin for a number of sites. Thanks!

    https://wordpress.org/plugins/video-thumbnails/

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

    (@sutherlandboswell)

    The plugin doesn’t overwrite the thumbnail ID to avoid overwriting a manually created featured image. You’ll just need to remove the featured image before resetting the video thumbnail.

    If you’d like to force it to always update the featured image ID, you can replace these three lines (267-269 in version 2.5.3) in video-thumbnails.php:

    if ( !ctype_digit( get_post_thumbnail_id( $post_id ) ) ) {
    	set_post_thumbnail( $post_id, $attachment_id );
    }

    with just this one line:

    set_post_thumbnail( $post_id, $attachment_id );

    I might make it an option to always update the featured image, but I didn’t think people would be changing video thumbnails very often.

    Thread Starter 12southmusic

    (@12southmusic)

    Super appreciate the help, Southerland.

    We actually don’t see a field in our WP Editor to remove a featured image, as the video thumbnail panel seems to replace that when the plugin is active. Do you mean unattach the image in the Media Gallery?

    To get around this, we created a separate field in this content type that allows folks to optionally override the Video Thumbnail, then upload their own image. This works, we were merely trying to be able to force update that ID as well.

    The code above seems to work for us, but it’d be great to include that as a plugin option in a later release. We build some media heavy websites with a client who is often changing things around in Vimeo and Youtube and wanting to see them update live on the site.

    Thanks again!

    Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    If a theme’s functions.php file includes add_theme_support( 'post-thumbnails' ); there should be a meta box for the featured image. Themes and plugins should be using this in combination with these functions rather than reading the _thumbnail_id field directly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Reset Video Thumbnail not updating Thumbnail ID’ is closed to new replies.