Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: New FB Autoconnect Plugin for WP…will it work with MU/BP?


peterverkooijen
Participant

@peterverkooijen

If you want to change or add to how user data is stored in the database, you can add some lines to this section of _process_login.php:

//Insert a new user to our database and notify the site admin
$user_login_id = wp_insert_user($user_data);
$user_login_name = $user_data['user_login'];
wp_new_user_notification($user_login_name);

I added the following to get fullname as display name, instead of just the first name:

$fullname = $fbuser['first_name'].' '.$fbuser['last_name'];
$firstname = $fbuser['first_name'];
$lastname = $fbuser['last_name'];

update_usermeta( $user_login_id, 'nickname', $fullname );

$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_login_id ) );

I could probably shorten that, but it works…

Skip to toolbar