Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for custom user_login values and enqueue styles correctly #76

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

haroldkyle
Copy link

Fixes #41

The open issue #41 suggested making this an option in the settings, but this could lead to confusion. (An option might mislead administators that they are making email addresses the user_login for everyone on the site, when this would only affect new registrations via SSO.)

Instead, I have introduced a filter that gives developers (who will know better, right?) the ability to modify the user_login value before the new user is inserted. In the case of creating an email login, they can just add this to the functions.php:

add_filter('social_connect_user_login', function( $user_login, $sc_email, $sc_first_name, $sc_last_name, $social_connect_provider ){
    return $sc_email;
},10,5);

Quick, painless, and solves the problem at hand. :)

@haroldkyle haroldkyle changed the title Allow for custom user_login values via social_connect_user_login filter Allow for custom user_login values and enqueue styles correctly Mar 18, 2015
@haroldkyle
Copy link
Author

Added code to enqueue styles properly so they don't get printed out at the wrong time. WP documentation says this needs to happen in wp_enqueue_scripts.

Also, dependencies need to be specified in script registration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a new option "Use e-mail as login"
1 participant