Created
January 3, 2015 13:46
-
-
Save MrVibe/c60418ed329ed609a487 to your computer and use it in GitHub Desktop.
WPLMS : Redirect student to the Custom section after Login
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 | |
if(!class_exists('WPLMS_Customizer_Plugin_Class')) | |
{ | |
class WPLMS_Customizer_Plugin_Class // We'll use this just to avoid function name conflicts | |
{ | |
public function __construct(){ | |
add_filter('login_redirect',array($this, 'buddypress_login_redirection'),100,3); | |
} // END public function __construct | |
function buddypress_login_redirection($redirect_url,$request_url,$user){ | |
global $bp; | |
$custom_redirect_url= bp_core_get_user_domain($user->ID).'/'.BP_COURSE_SLUG; /* You can also write $custom_redirect_url='http://google.com'; for custom location */ | |
return $custom_redirect_url; | |
} | |
public function activate(){ | |
// ADD Custom Code which you want to run when the plugin is activated | |
} | |
public function deactivate(){ | |
// ADD Custom Code which you want to run when the plugin is de-activated | |
} | |
// ADD custom Code in clas | |
} // END class WPLMS_Customizer_Class | |
} // END if(!class_exists('WPLMS_Customizer_Class')) | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where does one setup this?