hi
I have just discussed the same with my teammate and got this solution
add_filter('wplms_direct_access_tounit','enable_access_tostudents',999,2);
function enable_access_tostudents($flag,$post){ if(!empty($_GET) && !empty($_GET['access_token'])){
$token = urldecode ($_GET['access_token']);
$course_id = $_GET['id']; global $wpdb;
$user_id = $wpdb->get_var("SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = '$token'"); if(!empty($user_id) && is_numeric($user_id)){ $check = wplms_user_course_active_check($user_id,$course_id);
if($check){
return 0;
}
} }
return $flag;
}
and add your wplms token like this in unit URL
https://site.com/unit/instro/?access_token={your access token}