Skip to content

Instantly share code, notes, and snippets.

@MrVibe
Created January 3, 2015 13:46
Show Gist options
  • Save MrVibe/c60418ed329ed609a487 to your computer and use it in GitHub Desktop.
Save MrVibe/c60418ed329ed609a487 to your computer and use it in GitHub Desktop.
WPLMS : Redirect student to the Custom section after Login
<?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'))
?>
@uhlhosting
Copy link

Where does one setup this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment