Hi @amaa,
Please paste this code in your active theme’s functions.php file at the end to automatically login to a user when he clicks the confirmation link sent.
Here is the code:
//auto log in the users to my account page after clicking in the verification link
add_action( 'user_registration_check_token_complete', 'ur_auto_login_email_verification', 10, 2 );
function ur_auto_login_email_verification( $user_id, $user_reg_successful ) {
if( true === $user_reg_successful ) {
wp_set_auth_cookie( $user_id );
wp_safe_redirect( ur_get_page_permalink( 'myaccount' ) );
die();
}
}
Do Let me know if it helps or not and I will get back to you.
Regards!