Saltar navegación

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

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

Zona horaria del colaborador: Asia/Kolkata (GMT+05:30)

Este tema contiene 20 respuestas, tiene 2 mensajes.

Última actualización por Tien Nguyen 3 years, 6 months ago.

Asistido por: Minesh.

Autor
Mensajes
#2503131

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?

#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
Colaborador

Idiomas: Inglés (English )

Zona horaria: 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
Colaborador

Idiomas: Inglés (English )

Zona horaria: 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!