• Is there a way to change the validation error texts in registration? When users enter a username with a space I want them to receive an error saying: “Username must not contain spaces.” I found the following snippet of code online but it only works when a username has “admin” in it.

    add_action(‘um_submit_form_errors_hook_’,’um_custom_validate_username’, 999, 1);
    function um_custom_validate_username( $args ) {
    global $ultimatemember;

    if ( isset( $args[‘user_login’] ) && strstr( $args[‘user_login’], ‘admin’ ) ) {
    $ultimatemember->form->add_error( ‘user_login’, ‘Your username must not contain the word admin.’ );
    }
    }

    I tried to change ‘admin’ to an empty space and &nbsp but it didn’t work.

Viewing 1 replies (of 1 total)
  • Line 1758 in wp-content/plugins/ultimate-member/languages/ultimatemember-en_US.po

    I hope this helps,

Viewing 1 replies (of 1 total)

The topic ‘Custom validation error messages’ is closed to new replies.