Hey @word1press
I can recommend using the code snippet below to check for the + sign in the email address:
// Block submissions from email addresses that contain + symbol
function wpf_blacklist_emails( $field_id, $field_submit, $form_data ) {
//
if( strpos($field_submit, "+") !== FALSE ) {
wpforms()->process->errors[ $form_data['id'] ][ $field_id ] = esc_html__( 'We apologize for any inconvenience, we are unable to accept submissions using your email address.', 'wpforms' );
return;
}
}
add_action('wpforms_process_validate_email', 'wpf_blacklist_emails', 10, 3 );
In case it helps, here’s our tutorial with the most common ways to add custom code like this.
For the most beginner-friendly option in that tutorial, I’d recommend using the Code Snippets plugin.
@rizwan681 Thank you for your feedback, I will pass this on to the internal team. The following list of symbols have special meaning and might result in unexpected behavior:
[ \ ^ $ . | ? * + ( )
Thanks! ??