@andriiwork
I tried to find the UM PHP code where this “English letters only” is being validated and it’s not being implemented at all.
I have made an UM Bug report about your issue.
https://github.com/ultimatemember/ultimatemember/issues/1417
Thanks! @missveronicatv
You help me 🙂
This code work. (I have 4 language in my site).
function um_custom_validate_english_language( $key, $array, $args ) {
if ( preg_match('/[^A-ZĄĆĘŁŃÓŚŹŻa-ząćęłńóśźż0-9-]/', $args[$key] ) ) {
if (is_page('2974') && get_the_id() == 2974){
UM()->form()->add_error( $key, __( 'Пожалуйста, используйте только Английские буквы', 'ultimate-member' ) );
}
if (is_page('6412') && get_the_id() == 6412){
UM()->form()->add_error( $key, __( 'Будь ласка, використовуйте тільки Англійські літери', 'ultimate-member' ) );
}
if (is_page('6424') && get_the_id() == 6424){
UM()->form()->add_error( $key, __( 'Please use only English letters', 'ultimate-member' ) );
}
if (is_page('6432') && get_the_id() == 6432){
UM()->form()->add_error( $key, __( 'Proszę używać wyłącznie Angielskich liter', 'ultimate-member' ) );
}
}
}
add_action( 'um_custom_field_validation_english_language', 'um_custom_validate_english_language', 30, 3 );
-
This reply was modified 2 years, 3 months ago by
andriiwork.