Lego2012
12/13/2016 - 2:35 PM

Insert user using GF and log them in

Insert user using GF and log them in

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

<!-- Use gform_after_submission hook. -->

if ( ! is_user_logged_in() ) {
    // Log them in!
    wp_set_current_user( $user_id, $user->user_login );
    wp_set_auth_cookie( $user_id );
    do_action( 'wp_login', $user->user_login );
}