Contact Form 7 Custom Validation Doesn’t Get Called [closed]

First of all if you are already checking if the field is empty with that function, there’s no need to use * in the backoffice [email* your-email].

In any case, it’s not working because is_required()executes first than your function.

Solutions:

1) Remove the * in the backend

OR

2) Change the priority

// From 20 to 5 should work
// You only need to apply this to this filter as it is the one for required fields

add_filter( 'wpcf7_validate_email*', 'custom_email_confirmation_validation_filter', 5, 2 );

Hope it helps!