Sign Up
add_action('um_custom_field_validation_user_email_details','um_custom_validate_user_email_details', 999, 3);
function um_custom_validate_user_email_details( $key, $array, $args ) {
if ( $key == 'user_email' && isset( $args['user_email'] )) {
if ( $args['user_email'] == '' ) {
UM()->form()->add_error( 'user_email', __( 'E-mail Address is required', 'ultimate-member' ) );
} elseif ( !is_email( $args['user_email'] ) ) {
UM()->form()->add_error( 'user_email', __( 'The email you entered is invalid', 'ultimate-member' ) );
} elseif ( email_exists( $args['user_email'] ) ) {
UM()->form()->add_error( 'user_email', __( 'The email you entered is already registered', 'ultimate-member' ) );
}
}
}