moein Posted October 7, 2019 Share Posted October 7, 2019 Hello all my theme itself has the feature of logging in with Google but there are some drawbacks Hope you can help me My theme uses this file (socials-auth.php) to login with Googlehttp://txt.do/1ktj8 I want the user to not redirect after logging into /my-account page and become the same as the current page line 57 and 75 wp_redirect( get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ) ); And after the user login, his Gmail name will appear with a random number, But I want to get the name and lastname from his Google account and display it on the site (pre_user_nickname) line 62 if ( ! empty( $userProfile ) ) { $email = $userProfile->email; if ( email_exists( $email ) ) { $user_data = get_user_by( "email", $email ); mf_login_user( $user_data ); wp_redirect( get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ) ); } else { list( $user_login, $no_matter_data ) = explode( '@', $email ); $u_login = $user_login . rand( 1000, 9999999 ); $password = bin2hex( random_bytes( 15 ) ); $user_register_data = [ 'user_login' => apply_filters( 'pre_user_login', $u_login ), 'user_email' => apply_filters( 'pre_user_email', $email ), 'user_pass' => apply_filters( 'pre_user_pass', $password ), ]; Hope you can help me thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.