Hey Guys,
I've been playing around with wp_insert_user(). It seems to not work if I set an ID. If I leave that ID empty, then it will create the user just fine. The thing is, I really want to be able to set the ID (I want the new users ID to match their Facebook ID).
Am I doing something wrong? Or do you think this is a bug?
/*
* Create WP
* http://codex.wordpress.org/Function_Reference/wp_insert_user
*/
add_action('wp', 'create_wp_user');
function create_wp_user() {
$wp_user_data = array(
'ID' => 12345,
'user_pass' => wp_generate_password(),
'user_login' => $login,
'user_email' => $email,
'display_name' => $name,
'first_name' => $first_name,
'last_name' => $last_name,
'role' => get_option('default_role')
);
wp_insert_user($wp_user_data);
}
}