Get YouTube Video ID Hook
-
Hi Ben.
In a previous support post, you mentioned a hook to retrieve the YouTube video ID (this hook is called after the YouTube upload and just before the ID is saved into gravity forms):
add_action(‘prso_gform_youtube_uploader_pre_update_meta’, ‘prso_get_youtube_id’);
function prso_get_youtube_id( $field_values, $form_data ) {
//$field_values is an array containing array of field_ids and video ids
//$form_data contains info on the submitted form and entries
}
Can you explain in a little further detail how to go about saving that ID to a custom field? I have a GravityForm set up now which uses all post fields, and those post to a custom post type. The last piece I need is to get my YouTube video ID and post that into a custom field so I can then display the video on the front end (per entry).
Any help is greatly appreciated!
- The topic ‘Get YouTube Video ID Hook’ is closed to new replies.