View difference between Paste ID: 1i0wwEXZ and NNNimdnL
SHOW: | | - or go back to the newest paste.
1
/**
2
Redirect users to their PeepSo Profile on Login
3
@param string $url default LLMS login url
4
@param int $user_id WP User ID of the user who logged in
5
@return string
6
*/
7
function wbcom_login_redirect_to_peepso_profile( $url, $user_id ) {
8
	if( class_exists( 'PeepSoUser' ) ) {
9
		$peepso_user = PeepSoUser::get_instance( $user_id );
10
	    $profile_url = $peepso_user->get_profileurl();
11
	    $url = $profile_url;
12
	}
13
	return $url;
14
}
15
add_filter( 'lifterlms_login_redirect', 'wbcom_login_redirect_to_peepso_profile', 999, 2 );