Validation | WordPress.org

[ad_1]

@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 11 minutes ago by andriiwork.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer