Jump to content
Sign in to follow this  

Basic php help - PHP hooks

Recommended Posts

Hi everyone


I've been developing Wordpress sites for years but never had to go into PHP until now. 


I have a Gravity form and another plugin called Gravity Advanced File Uploader. What I am trying to do is retrieve a YouTube ID when the user uploads a video via the form and store it in another field automatically. The video currently uploads using a YouTube API key before the form is submitted.


The plugin developer has supplied the hook needed but being new to PHP I have no idea how to integrate this.


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





I'm assuming I also need to use something like gform_field_value as well to store the retrieved video ID.


Sorry if this seems confusing, I really am new to all this code!



Thanks in advance.

Edited by jms006

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.