Jump to content

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
Link to comment
https://forums.phpfreaks.com/topic/303033-basic-php-help-php-hooks/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
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.

×
×
  • 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.