Skip Navigation

[Resolved] Saving Meta Data – CRED API

This support ticket is created 7 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 46 replies, has 3 voices.

Last updated by troyC 7 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#446140
custom_code1.png

I am trying to combine the clipchamp API button (www.clipchamp.com/forgeeks) with CRED forms.

When a CRED submit button is pressed I want it to save meta data:

- userid
- video id
- Video Iframe url

This has been developed for me @ hidden link (must register to see.... register @ hidden link)

- title
- description
- e-mail
- userid
- video id
- Video Iframe url

These fields are saved to the custom post type "videos"

The problem is that I want to replace the form @ hidden link with a CRED form. I've tried to do that @ hidden link

I believe I have to create a wordpress CRED SAVA DATA function but can you please help me with this????

I've just extended my toolset subscription for a liftetime and support has been good so far but I'm very dissapointed in the response I received from Toolbox consultants!!!! I've contacted every company listed here and I've recieved NO to NEGATIVE responces!!!!! I've now payed another company to do RESEARCH on wp types and now they can not figure it out!!!! I would really appreciate some step by step help here,. Ive sent a screenshot of what the webdweveloper has sent to me... no idea how they are trying to make this work

#446345

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Troy,

Thank you for contacting our support forum.

I must apologize for the lengthy delay in response. Let me see how best I can assist you with this.

From you screenshot I see that you want to populate a custom field using a regular input html field.

Is there any particular reason why you chose to use an input html field rather our cred_generic fields ?

Thanks,
Shane

#446540

Thank you for your response Shane...

I don't know the best way is to accomplish what I want.....

I was expecting you have to use a Save Data function and then It will save videoid / url & userid to some hidden fields....

The screenshot is how an external company try to do it for me.... They don't have much experience with wp-types.

#446601

Will I have to wait 7 hours again for answer or is there someone else that can help me a bit quicker? Appreciate it

#446742

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Troy,

No you won't have to wait that long 🙁

I'm just trying to figure out what you are trying to achieve.

We do have a save data hook to manually save the custom field information but the video id and url where would those be coming from ? will the users be entering the video id and url ?

Also the user id will it be the id of the current user that is entering the data?

We need to understand where the data will be coming from to understand how to proceed.

Thanks,
Shane

#446749

Ok im sorry if i'm not clear.... video id and url is coming from the clipchamp api button...after a video is uploaded to YouTube.

The following script has been devloped.

hidden link
hidden link

upload-finish.php :

<h2>Video Upload SucessFully</h2>
<br/>
<a href="hidden link">Visit My Account</a>
<?php
$videoUrl = '';
if(isset($_POST, $_POST['video-link']) && !empty($_POST['video-link'])){
$data = $_POST['video-link'];
$data = explode('?', $_POST['video-link'], 2);
if(count($data) > 1){
$videoUrl = str_replace("v=", "", $data[1]);
}
}
?>

<?php
//print_r($_REQUEST);
$iframesaction = "hidden link";
$current_user = wp_get_current_user();
$userid = $current_user->ID;
$user_email = $current_user->user_email;

global $wpdb;

$current_user_id= get_current_user_id();
$post = array(
'post_author' => $current_user_id,
'post_content' => $_POST['videodescription'],
'post_excerpt' => $_POST['videodescription'],
'post_status' => "publish",
'post_title' => $_POST['videotitle'],
'post_type' => "videos",

);

//Create post
$post_id = wp_insert_post( $post, $wp_error );

$attach_id = get_post_meta($product->parent_id, "_thumbnail_id", true);
add_post_meta($post_id, 'wpcf-video-id', $videoUrl);
add_post_meta($post_id, 'wpcf-video-iframe', $iframesaction);
add_post_meta($post_id, 'wpcf-user-id', $userid);
add_post_meta($post_id, 'wpcf-emailid', $user_email);

} ?>

#446750

Yes... i want to also save the current user id

#446819

hello?

#446831

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Troy,

The proper way to hook into the CRED save data api is by using the hook in the link below.
https://toolset.com/documentation/user-guides/cred-api/#csd

The code you posted wouldn't work for the CRED form.

Also i'm still not clear on the exact issue as i'm not seeing a clear definition of what is to be achieved. I might be over simplifying things but why not create a video custom field with types and allow users to upload their videos there.

Thanks,
Shane

#446844

Hello Shan,

This form works.... hidden link

This is what I want.

You fill in the title when you push the clipchamp button. You can record a video with your webcam. It will then upload to YouTube. I then get redirected. When I look in my backend

i see user id and youtube video id in my custom post type "video".

The Problem is ................. It is not a Cred form. I would like to attach a cred form to clipchamp button on .hidden link.....

I tried at hidden link

Sorry if I'm confusing.. I hope you understand more??

#446848

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Troy,

It seems I need to log in before I can see the form.

Could you create some temporary credentials for me ?

The private fields will be enabled for your next response.

Thanks,
Shane

#446849

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Ok I understand clearer now and this CRED form, what should it do ?

#446850

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Also if it involves adding the video URL to the CPT you wouldn't need to use a CRED form as long as you have the url you can manually add it to the custom field using the update_post_meta function.

Thanks,
Shane

#446864

Hello Shane,

Do you understand what I'm trying to achieve? Did you receive my information? Are you still able to help me tonight? Thank you

#447386

hello ???

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.