I am using a plugin modified for my purposes.
What I am after is after the user has registered for it to automatically log them in and return them to the current page. At the moment it sends them an email with their username and password. They then have to log in using those details.
Basically to log a user in you can use:
//Login the user
$creds = array();
$creds['user_login'] = $login;
$creds['user_password'] = $password;
if ( !empty( $remember ) ){
$creds['remember'] = true;
}
$user = wp_signon( $creds, true );
but that is only when you have the password and login
so you can create your own register form and process it and create the user yourself
//Only after Everything has been validated, proceed with creating the user
//Create the user
$user_pass = wp_generate_password();
$user = array(
'user_login' => $username,
'user_pass' => $user_pass,
'first_name' => $firstname,
'last_name' => $lastname,
'user_email' => $email
);
$user_id = wp_insert_user( $user );
/*Send e-mail to admin and new user -
You could create your own e-mail instead of using this function*/
wp_new_user_notification( $user_id, $user_pass );
and here we have both login and password so you can log the user in.
Hope this helps