Plugin Author
Claude
(@claudeschlesser)
Hello,
to remove any spaces from the user’s login, you can simply use this filter:
function oa_social_login_filter_user_fields ($user_fields)
{
$user_fields['user_login'] = str_replace(' ', '', $user_fields['user_login']);
return $user_fields;
}
//This filter is applied to new users
add_filter('oa_social_login_filter_new_user_fields', 'oa_social_login_filter_user_fields');
The code must be added to the end of the functions.php file of your WordPress theme. By doing so your changes will not be overwritten when you install a new version of Social Login. You can find this file in your WordPress admin area under Appearance \ Editor \ Theme Functions (functions.php)
Do not hesitate to ask if I can be of any help.
-
This reply was modified 6 years, 1 month ago by
Claude.
Hi @claudeschlesser
I have the same problem with BuddyPress, but when I tried to past your code (with modifications), it does not work, can you help me ?
Thank you
function login_filter_user_fields ($user_fields)
{
$user_fields['user_login'] = str_replace(' ', '', $user_fields['user_login']);
return $user_fields;
}
//This filter is applied to new users
add_filter('login_filter_new_user_fields', 'login_filter_user_fields');