Skip Navigation

[Resolved] A form for visitor to send email to the post's author

This support ticket is created 2 years, 2 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.

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

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 20 replies, has 2 voices.

Last updated by Tien Nguyen 2 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#2503131

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I want to clarify first both form having two repeating field group or each form is having one each?

#2503149

Repeatable group thong-tin-mua-lai is for form id 883.
Repeatable group thong-tin-thue-lai is for form id 1352.
Field names of them are the same, but they're different and seperate.
(Each form is having one repeatable field gorup)

#2503155

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

could you please try to use the following code that will help you to resolve your issue.

You can remove the existing "cred_save_data" hook code I shared before and use the following one that is for both the forms.

add_action('cred_save_data','func_custom_set_parent',15,2);
function func_custom_set_parent($post_id,$form_data) {
    if ($form_data['id']==883) {
         toolset_connect_posts('thong-tin-mua-lai',$_POST['@thong-tin-mua-lai_parent'], $post_id);
    }else if($form_data['id']==1352){
         toolset_connect_posts('thong-tin-mua-lai',$_POST['@thong-tin-thue-lai_parent'], $post_id);
   }
}
#2503159

I adjusded a little. Do you mean:

add_action('cred_save_data','func_custom_set_parent',15,2);
function func_custom_set_parent($post_id,$form_data) {
if ($form_data['id']==883) {
toolset_connect_posts('thong-tin-mua-lai',$_POST['@thong-tin-mua-lai_parent'], $post_id);
}else if($form_data['id']==1352){
toolset_connect_posts('thong-tin-thue-lai',$_POST['@thong-tin-thue-lai_parent'], $post_id);
}
}

I've done. Thank you a lot, Minesh. I don't have any question for this issue.

#2503167

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Happy to share all required solutions and really glad to help you. You are welcome to mark resolve this ticket.

#2503171

My issue is resolved now. Thank you!