Created
June 9, 2020 11:55
-
-
Save reachkamrul/c541fb9d40ff81ee7cd6ae0fd5d9fc44 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('fluentform_before_insert_submission', function ( $insertData, $data, $formId ) { | |
if($formId->id != 52) { // You can pass your form id here | |
return; | |
} | |
// Email based check | |
$isExist = wpFluent()->table('users') | |
->where('user_email', $data['email']) | |
->first(); | |
if($isExist) { | |
wp_send_json(['errors' => [ | |
'restricted' => [ | |
'Sorry! there are already an account registered with your email.' | |
] | |
]], 422); | |
} | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment