Viewing 4 replies - 1 through 4 (of 4 total)
  • if you look in Githhub there is some code you can use do restrict spaces

    strangerstudios/paid-memberships-pro

    or there is this code that Might help

    // Restrict username registration to alphanumerics
    function limit_username_alphanumerics ($continue_registration) {
    
        global $username;
    
        if (! preg_match('/^[A-Za-z0-9]{3,16}$/', $username) ){
            pmpro_setMessage(__("Username can only contain alphanumerics (A-Z 0-9)", "pmpro"), "pmpro_error");
            $pmpro_error_fields[] = "username";
            $continue_registration = false;
        }
    
        return $continue_registration;
    }
    add_filter('pmpro_registration_checks', 'limit_username_alphanumerics');
    Thread Starter diondkb

    (@diondkb)

    Thank you.

    Hi Pete,

    Where did you put this code?

    Hi this code didn’t seem to work, did it work for you guys?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Deny spaces in checkout usernames’ is closed to new replies.