rtCamp / login-with-google

Minimal plugin which allows WordPress user to login with google.
https://wordpress.org/plugins/login-with-google/
GNU General Public License v2.0
63 stars 17 forks source link

Collect First and Last Name while Creating a user account #101

Closed klmnweb closed 2 years ago

klmnweb commented 2 years ago

The plugin does not collect user First and Last name while creating a WP account with the user Google email address. Only the user email is collected.

ankitrox commented 2 years ago

Check this hook which provides the entire user object from Google which contains information like first name, last name etc. to use it once the user has been created successfully.

In order to keep the plugin minimal, we are not adding any extra information in profile, but plugin has the provision to handle this scenario.

klmnweb commented 2 years ago

Thanks @ankitrox . It did work. I am now able to collect the first as well as last name. For others, this is the reference

'first_name' => $user->given_name, // get the first name
'last_name' => $user->family_name, // get the last name
abhishekfdd commented 2 years ago

PR #115 for this is merged. First Name and Last name will be saved in WP profile at the time of registration.