Guest User

LifterLMS Login Redirect To PeepSo Profile Page

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