lundi 30 mai 2016

WooCommerce Social Login - Usernames

I was sent here by WooThemes as giving coding examples is apparently against their Support Policy? I'm hoping one of you have experience with this and I'm in the right place. As an FYI, I'm novice with Wordpress and programming in general so please keep that in mind. Thanks.

Anyway, the WooCommerce Social plugin creates usernames from the users email address which doesn't look very good, especially when you don't want to broadcast it on a social site. Here is what they said in their FAQ regarding it:

Q: I don’t want the plugin to create usernames from the user’s email. How do I change this?

A: We have a filter that will let you change this. You’d use the

wc_social_login_{$provider_id}_new_user_data

filter listed in our hook reference to change the 'user_login' to something else, such as a first name, unique ID, or random string.

This is the link they provided http://ift.tt/1U1Dn7a.

Can anyone provide some direction? I have no idea how to use a filter to achieve creating a username from the first name and a random string and then save it to the database.

Thanks so much in advance!

Raw



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire