Created
March 27, 2015 07:29
-
-
Save danielmcclure/f347cfabd02e5e628a0c to your computer and use it in GitHub Desktop.
Auto-Login After Registration on Gravity Forms for WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Auto-login After Gravity Forms Registration */ | |
add_action( 'gform_user_registered', 'tme_gravity_registration_autologin', 10, 4 ); | |
function tme_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 | |
) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment