easydigitaldownloads/Easy-Digital-Downloads — pull request #1750 by sumobi (2013-11-25 00:00:41+00:00)
Title: Restructure of edd_register_and_login_new_user()

This slight restructure keeps the code functioning how it did before, but allows $user_args to now be available for use later on in the `edd_register_and_login_new_user()` function.

I'm rebuilding the way EDD Auto Register works and keeping it as close to EDD as possible, whereby it registers the user before sending to payment gateway, regardless of whether the payment is marked as completed etc. Currently the plugin cannot register users if using an off-site gateway.

Essentially, I'm using the `edd_insert_user_args` filter to create a random password and setting the user_login to the users email, and then sending it back to the function. I need to be able to pass the new login and password to the `edd_log_user_in()` function.

This is how it is currently
`edd_log_user_in( $user_id, $user_data['user_login'], $user_data['user_pass'] );`

I need this to use the new login and password that I have filtered in $user_args

`edd_log_user_in( $user_id, $user_args['user_login'], $user_args['user_pass'] );`

What is the cleanest way you can think of to accomplish this?