Hi! I'm adding custom fields for user registration, and I've got the fields saving in the "meta" column of the wp_signups table, but I can't figure out how to move that "meta" array over to wp_usermeta when the user activates. Here's what I'm trying, but it causes a "Unknown column" database error (even though I can see the data in MySQL), and it doesn't save the new fields to wp_usermeta:
...
add_action('user_register', 'usas_reg_usermeta'); // Hooks to end of wp_insert_user function in wp-includes/registration.php
...
function usas_reg_usermeta($user_id) {
global $wpdb;
$new_userinfo = get_userdata($user_id);
$new_username = $new_userinfo->user_login;
$new_usermeta = $wpdb->get_results("SELECT meta FROM $wpdb->signups WHERE user_login = $new_username");
foreach ($new_usermeta as $meta_key=>$meta_value) {
update_usermeta($user_id, $meta_key, $meta_value);
}
}
Any ideas? What's the more graceful way to do this? Is storing the new fields in wp_usermeta unnecessary? (Seems useful in order to get_usermeta later.)
Note: I've looked through code for Register Plus and Cimy Extra Fields do this, but I can't figure it out -- both plugins are probably doing things much more sophisticated than what I'm trying to do.