How can I make a specific form perform the auto login action and then redirect to a specific URL?
Dear Fernando,
There isn't such a built-in feature within Toolset plugins, and I don't think it is built-in feature of wordpress, you will always need to enter a user name and password
There is a login form shortcode within Views plugin:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-login-form
but you can search it in wordpress.org, for example:
https://wordpress.org/plugins/search/autologin/
Hope this helps
I have a function that performs autologin after registration and it works correctly, but I need to be able to apply it only to a specific form, how can I do it?
This is the function:
function auto_login_new_user( $user_id ) {
wp_set_current_user($user_id);
wp_set_auth_cookie($user_id);
// You can change home_url() to the specific URL,such as
//wp_redirect( 'hidden link' );
wp_redirect( home_url() );
exit;
}
add_action( 'user_register', 'auto_login_new_user' );
If you are using CRED form to register the new users, I suggest you try with CRED action hook "cred_save_data" to trigger your custom PHP function, there you can specific the CRED form ID, see our document:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
Agument form_id: The form ID.