Okay it works! Sadly I had to put it straight into my login hook or it wouldn’t work. Now I just need to figure out how to get my notify mail rolling again.
Great documentation btw! Very useful!
add_action( 'wpmem_post_register_data', 'my_registration_hook', 1 );
function my_registration_hook( $fields ) {
$creds = array();
$creds['user_login'] = $fields['username'];
$creds['user_password'] = $fields['password'];
$creds['remember'] = false;
$first_name = $fields['billing_first_name'];
$last_name = $fields['billing_last_name'];
update_user_meta($fields['ID'], 'first_name', $first_name);
update_user_meta($fields['ID'], 'last_name', $last_name);
$user = wp_signon( $creds, is_ssl() );
if ( ! is_wp_error( $user ) ) {
wp_redirect( $_SERVER['REQUEST_URI'] );
exit();
} else {
return "loginfailed";
}
}