title: Update User Meta after Registration
body: <p>In wordpress, after a user registers, I am using the function below to create two pages of two different custom post types, and I then need to store a custom meta value in their user data to assist with redirects later. I've found that if I specify custom meta values during registration (on registration form), I can retrieve these values later with :</p>
  
  <pre><code>global $current_user;
      get_currentuserinfo();
      $theirRedirectKey = $current_user-&gt;rpr_redirect_key;
  </code></pre>
  
  <p>However, in the following functions.php snippet, I can't the meta value to save for retrieval later.</p>
  
  <pre><code>function after_registration($user_id){
      // Get the Newly Created User ID
      $the_user = get_userdata($user_id);
  
      // Get the Newly Created User Name
      $new_user_name = $the_user-&gt;user_login;
  
      // Create a unique Tour Code Prefix from User ID
      $tourPrefix = $the_user-&gt;ID;
  
      // Check for Tour Code Key if entered into registration form
      $enteredKey = $the_user-&gt;rpr_redirect_key;
  
      if($enteredKey == ''){
          //Create the first Tour Builder Page
          $tourBuilder = array();
          $tourBuilder['post_title'] = $new_user_name . '| Custom Educational Tour';
          // Next line may not be important after hubpages are set up.
          $tourBuilder['post_name'] = 'builder-' . $tourPrefix;
          $tourBuilder['post_type'] = 'builder';
          $tourBuilder['post_content'] = 'This is the content!';
          $tourBuilder['post_author'] = $user_id;
          $tourBuilder['post_status'] = 'publish';
          $tour_id = wp_insert_post( $tourBuilder );
  
          // Build hubpage
          $hubpage = array();
          $hubpage['post_title'] = $new_user_name . '\'s Hubpage';
          // URL must be unique
          $hubpage['post_name'] = $new_user_name;
          $hubpage['post_type'] = 'hubpages';
          $hubpage['post_author'] = $user_id;
          $hubpage['post_status'] = 'publish';
          $hub_id = wp_insert_post( $hubpage );
  
          //Update User with proper redirect keys for some reason this line doesn't work.
          add_user_meta($the_user, 'rpr_redirect_key', '/hubpage/' . $new_user_name, true);
      }
  
  }
  add_action('user_register', 'after_registration');
  </code></pre>
  
  <p>Help would be much appreciated.</p>