Thanks for getting back.
I found indeed a code snippet that allows this.
What I would is that when a unit is clicked on the course page it gets loaded in the pursue course view. Is it possible by adjusting this piece of code a bit:
add_filter('wplms_curriculum_course_link','enable_course_students_view_units_curriculum1226');
function enable_course_students_view_units_curriculum1226($enable){
$user_id = get_current_user_id();
$course_id = get_the_ID();
if(wplms_user_course_active_check($user_id,$course_id))
return 1;
return $enable;
}
add_filter('wplms_direct_access_tounit','enable_access_tostudents1226',10,2);
function enable_access_tostudents1226($flag,$post){
global $wpdb;
$user_id = get_current_user_id();
$course_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key= 'vibe_course_curriculum' AND meta_value LIKE %s LIMIT 1;", "%{$post->ID}%" ) );
$check = wplms_user_course_active_check($user_id,$course_id);
if(!empty($check)){
return 0;
}
return $flag;
}