Skip to content

Commit

Permalink
Added a filter & a hook to process the new user account
Browse files Browse the repository at this point in the history
  • Loading branch information
Frique committed Aug 6, 2014
1 parent 044de0c commit 1bb236e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion social-connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,13 @@ function sc_social_connect_process_login( $is_ajax = false ) {
$userdata = array( 'user_login' => $user_login, 'user_email' => $sc_email, 'first_name' => $sc_first_name, 'last_name' => $sc_last_name, 'user_url' => $sc_profile_url, 'user_pass' => wp_generate_password() );

// Create a new user
$user_id = wp_insert_user( $userdata );
$user_id = wp_insert_user( apply_filters( 'social_connect_insert_user', $userdata ) );

if ( $user_id && is_integer( $user_id ) ) {
update_user_meta( $user_id, $sc_provider_identity_key, $sc_provider_identity );
}

do_action( 'social_connect_inserted_user', $user_id, $social_connect_provider );
} else {
add_filter( 'wp_login_errors', 'sc_login_errors' );

Expand Down

0 comments on commit 1bb236e

Please sign in to comment.