show the course forum at the end of each unit

You can show the course forum at the end of each unit by adding this code in your wp-content/plugins/wplms-customizer/wplms-customizer.php file :

add_action('wplms_after_every_unit','show_course_forum',10,1);
function show_course_forum($unit_id){
    
    global $wpdb;
    $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;", "%{$unit_id}%" ) );
    $course_forum=get_post_meta($course_id,'vibe_forum',true);
    if (isset($course_forum))
    echo '<a class="button full" href="'.get_permalink($course_forum).'" >'.get_the_title( $course_forum ).'</a>';
}