I have made a registration form which have only two fields email and password .Now i want to add user to WordPress database but wp_create_user()
require username too.Then i tried using another function as $status=wp_insert_user($userdata);
where $userdata is an array containing elements as
$userdata = array(
'user_pass' => $pswrd,
'user_email'=> $email
);
but user is not added in database. Is their any other function through which i can add user with above two fields only.
Try this one example
If you don’t want to ask the user for a specific login name, you could use their e-mail: