Skip to content

Instantly share code, notes, and snippets.

@thomasplevy
Created October 14, 2017 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasplevy/40a9d59ae826489f09b9449b241e8538 to your computer and use it in GitHub Desktop.
Save thomasplevy/40a9d59ae826489f09b9449b241e8538 to your computer and use it in GitHub Desktop.
<?php // don't copy this to your functions.php file
/**
* Redirect users to their LifterLMS Social Learning Profile on Login
* @param string $url default LLMS login url
* @param int $user_id WP User ID of the user who logged in
* @return string
*/
function my_llms_student_dashboard_login_redirect( $url, $user_id ) {
if ( function_exists( 'llms_sl_get_student_profile_url' ) ) {
$url = llms_sl_get_student_profile_url( $user_id );
}
return $url;
}
add_filter( 'lifterlms_login_redirect', 'my_llms_student_dashboard_login_redirect', 999, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment