kylegilman / video-embed-thumbnail-generator

A WordPress plugin that generates thumbnails, HTML5-compliant videos, and embed codes for locally hosted videos. Requires FFMPEG or LIBAV for encoding.
http://wordpress.org/plugins/video-embed-thumbnail-generator/
GNU General Public License v2.0
48 stars 27 forks source link

Disable setting the featured image of a page #543

Open Paulsky opened 3 months ago

Paulsky commented 3 months ago

I have a page where I have multiple video's placed before I installed VideoPack. This page is fully designed and complete.

When I now edit a video in the media library which is on that page, and I choose a generated image via generate thumbnail, the thumbnail is set as featured image for the video (which is good).

But also as featured image on the page. It even overwrites a featured image of the page if the page has a different featured image.

How can I disable this function? Thank you in advance.

Paulsky commented 3 months ago

Shouldn't there be another condition added before set_post_thumbnail( $post->post_parent, $featured_id ); to check for $options['thumb_parent'] === 'post'?

Here https://github.com/kylegilman/video-embed-thumbnail-generator/blob/218bbc34d3fccc262305e11ea9fdeed8e83894bf/src/admin/videopack-admin.php#L2930C3-L2932C3

Like this:

if ( $kgvid_postmeta['featuredchanged'] === 'true'
    && ! empty( $featured_id )
    && $options['thumb_parent'] === 'post'
) {
    set_post_thumbnail( $post->post_parent, $featured_id );
}

And also here https://github.com/kylegilman/video-embed-thumbnail-generator/blob/218bbc34d3fccc262305e11ea9fdeed8e83894bf/src/admin/videopack-admin.php#L3612

Like this:

if ( $options['thumb_parent'] === 'post' && isset( $attachment['kgflashmediaplayer-featured'] )) {

kylegilman commented 2 months ago

You should be able to prevent setting the parent post's featured image by turning off "Set generated video thumbnails as featured images." in the Videopack settings page.

Paulsky commented 2 months ago

I would like to set the featured image of the video. I have just checked the setting and the checkbox is unchecked.

Paulsky commented 2 months ago

@kylegilman what are your thoughts about this?

kylegilman commented 1 month ago

Sorry, I haven't been able to work on this. I'll get to it eventually. You might have the Featured Image setting enabled on the individual videos, which would override the more general setting. Or there's something in the code that's ignoring whether that setting is enabled. The thumb_parent option shouldn't matter here. And regardless of any setting, the video's featured image is always set to the thumbnail.