WordPress.org

Forums

Video Thumbnails
[resolved] Reset Video Thumbnail not updating Thumbnail ID (4 posts)

  1. 12southmusic
    Member
    Posted 1 year ago #

    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/

  2. Sutherland Boswell
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. 12southmusic
    Member
    Posted 1 year ago #

    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!

  4. Sutherland Boswell
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Video Thumbnails
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic