Mmm never mind, I solved:
add_action('save_post', 'save_other_video_thumbnail', 100, 1);
function save_other_video_thumbnail($post_id) {
$postdata = get_postdata($post_id);
if ($postdata['post_status'] == 'future') {
get_video_thumbnail($post_id);
}
}
I realy thank you! You save me…. THANKS A LOT for this fix! 🙂
Hi! I had the same problem, but I wanted to get video thumbs generated when I save as draft. I use to save lots of topics as draft and after a while I edit them and schedule it, but if you don’t have the video thumbnail generated right after the first save, you are unable to know if the thumbnail is nice enough 🙂
So, I added a bit of code to what CristianOspina did:
add_action('save_post', 'save_other_video_thumbnail', 100, 1);
function save_other_video_thumbnail($post_id) {
$postdata = get_postdata($post_id);
if ( $postdata['post_status'] == 'draft' OR $postdata['post_status'] == 'future') {
get_video_thumbnail($post_id);
}
}
Hope this help others with similar issues.
Thanks everybody for the ideas 🙂
This really needs to be built-in setting in the plugin, otherwise you have to remember to edit the code every time a new update is released, which is often.
@noyz319: you don’t need to touch the plugin files. The code may be pasted at the end of your theme’s functions.php file 😉
You’re right! I’ve been doing it the dumb way forever now, this is perfect. Thanks!