Minesh
Colaborador
Idiomas:
Inglés (English )
Zona horaria:
Asia/Kolkata (GMT+05:30)
I want to clarify first both form having two repeating field group or each form is having one each?
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)
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);
}
}
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.
Happy to share all required solutions and really glad to help you. You are welcome to mark resolve this ticket.
My issue is resolved now. Thank you!