Skip to:
Content
Pages
Categories
Search
Top
Bottom

Changing/removing username to email address, having user confirm email address

Viewing 4 replies - 1 through 4 (of 4 total)

  • navyspitfire
    Participant

    @navyspitfire

    Figured it out. This snippet of code removes username field and makes the email address the username, and I created a field and used the jquery validation plugin to validate.

    add_action( 'bp_core_validate_user_signup', 'custom_validate_user_signup' );
    
    function custom_validate_user_signup($result)
    {
      unset($result['errors']->errors['user_name']);
    
      if(!empty($result['user_email']) && empty($result['errors']->errors['user_email']))
      {
        $result['user_name'] = md5($result['user_email']);
        $_POST['signup_username'] = $result['user_name'];
      }
    
      return $result;
    }

    augustjohnston
    Participant

    @augustjohnston

    This is exactly the functionality I’m looking for. Can you please describe in further detail how to implement this? did you put this in Functions.php? or what? and how does the jquery validation plugin work in all this? aka step by step please.
    thanks!
    August


    navyspitfire
    Participant

    @navyspitfire

    Put it in your functions file. md5($result['user_email']) changes the user_nicename to random digits (I ended up removing the md5()).


    augustjohnston
    Participant

    @augustjohnston

    Did you use a child theme for this? any other problems?
    can you explain this further “and I created a field and used the jquery validation plugin to validate.”? … not sure what you mean by ‘created a field’ and I’ve never used that plugin… is it required?
    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar