Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rafiahmedd/15a25293a1224cf58c2250411f318c77 to your computer and use it in GitHub Desktop.
Save rafiahmedd/15a25293a1224cf58c2250411f318c77 to your computer and use it in GitHub Desktop.
Match two email to in Fluent Forms for multiple forms
add_filter('fluentform_validate_input_item_input_email', function($errorMessage, $field, $formData, $fields, $form) {
$targeted_forms =[22,23,24,25];
$target_form_id = 0;
foreach ($targeted_forms as $id){
if($form->id == $id){
$target_form_id = $id;
}
}
if($form->id != $target_form_id ) {
return $errorMessage ;
}
if( $formData['email'] != $formData['email_1'] ){
$errorMessage= ['Error! Email does not match'];
}
return $errorMessage;
}, 10, 5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment