Advertisement
vapvarun

Redirect users to their PeepSo Profile on Login

May 8th, 2018
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement