I followed the steps given in the url https://wplms.io/support/knowledge-base/redirect-non-logged-in-users-to-register-page-when-they-click-on-take-this-course-button/.
But it redirects me to the old register page (the BuddyPress register page), but I created a custom register page and set it as default in Vibeoptions.
May I know how do I redirect students to the custom register page instead of BuddyPress register page?
I think something to be changed here
$id = vibe_get_bp_page_id('register');
You can change the function with the bellow function and then add the url of your custom registration page in the code instead of vibethemes.com:
function custom_non_loggedin_user_redirect($html,$course_id){
if(!is_user_logged_in()){
$extra ='';
$page = 'http://vibethemes.com';
return '<a href="'.$page.'" class="course_button full button">'.apply_filters('wplms_take_this_course_button_label',__('TAKE THIS COURSE','vibe'),$course_id).apply_filters('wplms_course_button_extra',$extra,$course_id).'</a>';
}
return $html;
}