title: Buddypress - when user activates account,user role changes to default
body: <p>Iam working with buddypress,
  I have a two user roles,
  1-student 
  2-faculty
  and i have set default user role as subscriber.
  when user registers and activates account by clicking on link sent through mail.User role changes to default(subscriber).</p>
  
  <p>Any idea what is the issue? Below is the code assigning role to user on sign up.</p>
  
  <pre><code>add_action('bp_core_signup_user', 'ad_user_signup_usermeta', 10, 5);
  function ad_user_signup_usermeta($user_id, $user_login, $user_password, $user_email, $usermeta) {
  
          if(isset($_POST['signup_membership']) &amp;&amp; !empty($_POST['signup_membership']))
          update_user_meta($user_id, 'membership', $_POST['signup_membership']);
  
          $userdata = array();
          $userdata['ID'] = $user_id;
          if(!empty($_POST['signup_usertype'])) {
              if($_POST['signup_usertype'] == 'student') {
              $userdata['role'] = 'student';  
              }
              if($_POST['signup_usertype'] == 'instructor') {
              $userdata['role'] = 'instructor';   
              }   
          }
  
          if ($userdata['role']){
              wp_update_user($userdata);
          }
  
  }
  </code></pre>