
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Katja,
I'm still not able to link to the site as i'm still getting the error 404.
I did however have a look at the code again and it seems to be fine.
If its possible to even setup a test site with your environment or even provide me with a copy of the site so that I can have something to debug would be greatly appreciate.
Please let me know and we can move forward from there.
Thanks,
Shane
Really odd. Now I replaced the login address in the other fields too and deleted all the old addresses. Perhaps you didn't notice the rigth address was there in the textarea field. But now I think it should be the right one in all the fields.

Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Katja,
I've made some changes to the snippet and it should now be working as intended.
/**
* Auto-login new CRED user
*/
add_action( 'cred_save_data', 'tssupp_cred_autologin', 10, 2 );
function tssupp_cred_autologin( $post_id, $form_data ){
if ( 12788 == $form_data['id'] ) { // Edit as required
if ( !empty( $_REQUEST['user_email'] ) && !empty( $_REQUEST['user_pass'] ) ) {
// get the user credentials from the $_POST object
$user = array(
'user_login' => substr( $_REQUEST['user_email'], 0, strpos( $_REQUEST['user_email'], "@")),
'user_password' => $_REQUEST['user_pass'],
'remember' => true
);
$login = wp_signon( $user, false );
if ( is_wp_error($login) ) {
error_log( $login->get_error_message() );
}
}
}
}
I've tested it on your site and was able to get logged in directly after i've created my user.
Thanks,
Shane
Thank you very much Shane! My issue is resolved now. Thank you!