Create a unique Wordpress username with Userpro plugin and its facebook connect
£10-20 GBP
Cerrado
Publicado hace alrededor de 9 años
£10-20 GBP
Pagado a la entrega
I am using UserPro plugin to register new users. I want to use the Facebook connect feature.
Problem
It registers your username as your facebook username which is your email address. This unfortunately means your email address is on display in your profile url.
I would like one of the following situations:
I would like your wordpress username to be the first half of your email plus some sort of random number at the end of it so that you avoid duplicates.
OR
I would like your wordpress username to be a unique random mix of numbers or letters (to avoid duplicates).
PLEASE: the most important thing is that all usernames are unique.
Please - i can only deal with people who speak english fluently to communicate.
I can tell you the exact file to change. Here is some of the code for reference:
/* Facebook Connect */
add_action(\'wp_ajax_nopriv_userpro_fbconnect\', \'userpro_fbconnect\');
add_action(\'wp_ajax_userpro_fbconnect\', \'userpro_fbconnect\');
function userpro_fbconnect(){
global $userpro;
$output = \'\';
if (!isset($_POST)) die();
if ($_POST[\'action\'] != \'userpro_fbconnect\') die();
if (!isset($_POST[\'id\'])) die();
if (!isset($_POST[\'username\']) || $_POST[\'username\'] == \'\' || $_POST[\'username\'] == \'undefined\') {
$username = $_POST[\'email\'];
}
else {
$userame = $_POST[\'username\'];
}
/* Check if facebook uid exists */
if (isset($_POST[\'id\']) && $_POST[\'id\'] != \'\' && $_POST[\'id\'] != \'undefined\'){
$users = get_users(array(
\'meta_key\' => \'userpro_facebook_id\',
\'meta_value\' => $_POST[\'id\'],
\'meta_compare\' => \'=\'
));
if (isset($users[0]->ID) && is_numeric($users[0]->ID) ){
$returning = $users[0]->ID;
$returning_user_login = $users[0]->user_login;
} else {
$returning = \'\';
}
} else {
$returning = \'\';
}
$result=get_user_meta($returning,\"userpayment\");
$paymentoption=get_option(\'userpro_payment\');
Hello! We have carefully reviewed your requirements. I think it will be better to use email plus some sort of random number at the end of it. We are able to do it wright now. Please contact us to discuss details.
Best regards
Hello,
I have already been working with the LinkedIn Connect api to achieve similar results as what you are looking for.
I can help you with Skype and Teamviewer on Thursday evening if you accept my bid (I can be online at 7p.m. Paris Time)
Sincerely Yours,
Thomas