prashantkaushik
Forum Replies Created
-
Hi,
Now its work for me. I made some small changes in the code provided which works for me.
Please find my code.
*******************************************************************************//to add registration hook add_action( 'user_register', 'myplugin_registration_save', 10, 1 ); function myplugin_registration_save( $user_id ) { $location = home_url()."/?pb_autologin=true&pb_uid=$user_id"; echo "<script> window.location.replace('$location'); </script>"; } add_action( 'init', 'wppb_custom_autologin' ); function wppb_custom_autologin(){ if( isset( $_GET['pb_autologin'] ) && isset( $_GET['pb_uid'] ) ){ $uid = $_GET['pb_uid']; wp_set_auth_cookie( $uid ); delete_user_meta($uid, 'pb_autologin' . $uid ); delete_user_meta($uid, 'pb_autologin' . $uid . '_expiration'); wp_redirect( $url ); exit; } }***************************************************************************
Thanks for the great support.
PrashantHi,
This code is not working for me untill now.
Thanks
PrashantThanks for the information.
Actually i am not using email confirmation, user will be auto confirmed once he/she submit the form. I just create a registration form with short code. I only want that after registration he/she will be auto login in the site.
Is above mentioned the only way to do this?
Thanks,
Prashant- This reply was modified 9 years, 7 months ago by prashantkaushik.
Hi,
Yes, you understand it right. I want to do the same as you told.
Please help me in this.
Thanks & Regards
Prashant Kaushik