- add english letters validation

This commit is contained in:
ashubawork
2024-02-02 12:18:16 +02:00
parent 328de82d60
commit b406edc0ac
+10
View File
@@ -1016,6 +1016,16 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) {
break;
case 'english':
if ( '' !== $submitted_data[ $key ] ) {
if ( ! preg_match( '/^[a-zA-Z]*$/u', str_replace( ' ', '', $submitted_data[ $key ] ) ) ) {
UM()->form()->add_error( $key, __( 'You must provide english letters', 'ultimate-member' ) );
}
}
break;
}
} // end if ( isset in args array )