Merge pull request #1519 from ultimatemember/fix/unique_email_check

Fix unique_email validation
This commit is contained in:
Mykyta Synelnikov
2024-05-20 10:05:52 +03:00
committed by GitHub
+1 -1
View File
@@ -924,7 +924,7 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) {
UM()->form()->add_error( $key, __( 'You must provide your email', 'ultimate-member' ) );
} elseif ( 'register' === $mode && $email_exists ) {
UM()->form()->add_error( $key, __( 'The email you entered is incorrect', 'ultimate-member' ) );
} elseif ( 'profile' === $mode && $email_exists && $email_exists !== $submitted_data['user_id'] ) {
} elseif ( 'profile' === $mode && $email_exists && absint( $email_exists ) !== absint( $submitted_data['user_id'] ) ) {
UM()->form()->add_error( $key, __( 'The email you entered is incorrect', 'ultimate-member' ) );
} elseif ( ! is_email( $submitted_data[ $key ] ) ) {
UM()->form()->add_error( $key, __( 'The email you entered is incorrect', 'ultimate-member' ) );