Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
It seems we cross-posted the reply. Can you please check my last reply and confirm auto-login works.
My issue is resolved now. Thank you!
The above code works.
I believe it was this line here you added. Is that correct?
remove_filter('pre_user_login','smyles_custom_username_seq_pre_user_login');
Many thanks. This project goes out to thousands of students in Brazil, tomorrow. You help has been outstanding.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
This is the code for without email - you should add within cred_save_data hook.
// Login without email
if ( 1194 == $form_data['id'] ) {
remove_filter('pre_user_login','smyles_custom_username_seq_pre_user_login');
$my_username = smyles_generate_next_seq_user_login();
if ( !empty( $_POST['user_pass'] ) ) {
$newuser = get_user_by( "id", $new_user_id );
$signon = array(
'user_login' => $newuser->data->user_login,
'user_password' => $_POST['user_pass'],
'remember' => true
);
$login = wp_signon( $signon, false );
if ( is_wp_error($login) ) {
error_log( $login->get_error_message() );
}
}
};
Thanks for your kind words and feedback, you are welcome to mark resolve this ticket.