Skip to:
Content
Pages
Categories
Search
Top
Bottom

Allow uppercase on registration writing Username

  • @dalejray

    Member

    Hello!,

    (Sorry for my bad english).

    I have a website with Buddypress and, I noticed that during the registration the users can’t write characters uppercase in usernames, and i want delete this restrictions just for the register page, so that after changing user name in lowercase automatically. ¿Is possible this?

    Thanks! :)

Viewing 2 replies - 1 through 2 (of 2 total)
  • @yadigit

    Participant

    I believe it has something to deal with this piece of code, (file bp-membesr/bp-members-signup.php)
    `
    function bp_core_validate_user_signup( $user_name, $user_email ) {
    global $wpdb;

    $errors = new WP_Error();
    $user_email = sanitize_email( $user_email );

    if ( empty( $user_name ) )
    $errors->add( ‘user_name’, __( ‘Please enter a username’, ‘buddypress’ ) );

    $maybe = array();
    preg_match( “/[a-z0-9]+/”, $user_name, $maybe );
    `
    On line 311 you will see
    `preg_match( “/[a-z0-9]+/”, $user_name, $maybe );`
    Just add
    ` preg_match( “/[a-z0-9A-Z]+/”, $user_name, $maybe );`
    that should allow caps for user names.
    @dalejray

    @dalejray

    Member

    Should I replace the code or add after?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Allow uppercase on registration writing Username’ is closed to new replies.
Skip to toolbar