Hi,
For wplms 4, please add this code in wplms customizer.php
add_filter('wplms_curriculum_course_lesson','wplms_free_access_2',99,3);
function wplms_free_access_2($html,$lesson,$course_id){
$free=get_post_meta($lesson,'vibe_free',true);
if(!is_user_logged_in() && vibe_validate($free)){
return '<a class="login_trig" href="#login">'.get_the_title($lesson).'</a>';
}else{
return $html;
}
}
and Add this code in wplms>>footer>>google analytics code
<script>
jQuery("document").ready(function($){
$(".login_trig").on('click',function(event){
event.preventDefault();
$('a.vibebp-login span').trigger('click');
});
});
</script>
If it does not work on your site. then please provide your site URL with admin credentials in private reply. I will check on your site. As this code is working on my setup.