Gravity User Registration Auto Login
-
Hi Daniel, First off – What a great plugin!
Been tinkering with it and will be going with some of the pro features as soon as I am clear on all of the options. Keep up the good work…this is a beautiful plugin.
I set up a gravity form user registration form, and added the auto close popup script like this:
<script>
jQuery(‘#popmake-968959’).trigger(‘manualCookie’);
setTimeout(function () {
jQuery(‘#popmake-968959’).popmake(‘close’);
}, 100); // 2 seconds
</script>I have another function in my functions file that automatically signs in a new user after they register:
add_action( ‘gform_user_registered’, ‘pi_gravity_registration_autologin’, 10, 4 );
function pi_gravity_registration_autologin( $user_id, $user_config, $entry, $password ) {
$user = get_userdata( $user_id );
$user_login = $user->user_login;
$user_password = $password;wp_signon( array(
‘user_login’ => $user_login,
‘user_password’ => $user_password,
‘remember’ => false
) );
}Is there a way to both close the popup upon registration submission and log the new user in?
Regards
Will
- The topic ‘Gravity User Registration Auto Login’ is closed to new replies.