Created
October 14, 2017 00:42
-
-
Save thomasplevy/40a9d59ae826489f09b9449b241e8538 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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