Hello, I use this code to work with variables before the form is sent with wp_mail. I would like to know how to check a variable of the form if it is checked TRUE? The field name I want to check is: avia_7_1
add_filter('avf_form_send', 'avia_process_form_data', 10, 3);
function avia_process_form_data($send, $new_post, $form_params)
{
foreach ($new_post as $current_key => $current_post)
{
//loop through all contact form fields.
//check if field avia_7_1 is checked (checkbox = true)
// do something
}
return true; // enfold sending mail
}
Thank you for Enfold!
is this the right way?
$mysubject = urldecode($new_post['7_1']);
Hi royaltask,
Yes, this should work. Have you tried it yet?
Best regards,
Victoria