spivurno
2/25/2015 - 2:56 PM

Gravity Perks // GP Auto Login // Redirect to New Site on Auto Login

Gravity Perks // GP Auto Login // Redirect to New Site on Auto Login

/**
 * Gravity Perks // GP Auto Login // Redirect to New Site on Auto Login
 */
add_filter( 'gpal_auto_login_on_redirect_redirect_url', function( $url, $user_id ) {

	require_once( GFUser::get_base_path() . '/data.php' );

	$entry_id = get_user_meta( $user_id, 'entry_id', true );
	$site_id  = GFUserData::get_site_by_entry_id( $entry_id );

	$url = get_site_url( $site_id );

	return $url;
}, 10, 2 );