I have a video sharing site where users share videos from YouTube, Vimeo, Dailymotion etc, by adding their URL.
The video URL are added via FormidablePro and stored in the custom field “video_url” I’m using another plugin called Video Thumbails which creates thumbnails from the video URL.
The problem I’m having is Video Thumbnails can only create the image if the custom field “video_url” is saved prior to publishing the post.
What I need to happen is, when the user hits the submit button, it saves the custom fields first, then publishes the post — always in that order.
I know there’s a way to do it via functions.php, I just don’t know the code to do it.
Pleas help.




October 31, 2012 at 10:04 am
The post must be created before custom fields can be added. Would it work to create a draft post, then return to publish it?
October 31, 2012 at 10:49 am
Yes it would work if it's saved as a draft first then published, as long as it's automated and I don't have to go into each post to do the publishing it my self.
October 31, 2012 at 11:31 am
The easiest way is probably to trigger the other plugin when that custom field is updated. You can do this with a little added code in a new plugin or your theme functions.php.
add_action( 'updated_post_meta', 'trigger_video_thumbnails', 10, 3); function trigger_video_thumbnails($meta_id, $object_id, $meta_key){ if($meta_key == 'video_url') save_video_thumbnail( $object_id ); }October 31, 2012 at 12:18 pm
Hmm, it didn't create the thumbnail.
When I'm posting from the back-end, when I save a post and then publish it, the thumbnail is created.
However in the front end with Formidable, the post isn't actually created until the user hits the submit button.
Is it possible to maybe use the save_post action prior to publishing to post?
October 31, 2012 at 12:25 pm
You'll need to troubleshoot this on your own. That function above should get you headed in the right direction. You can ask the video thumbnail plugin authors as well. That function isn't directly related to Formidable.
Topic closed.