Learndash : Easy way to disable lesson progression & show next and previous button ?

learndash snippet for

Have you noticed that lessons in a course progress on its own. But only the registered users to a course can see the lessons progression. If a user is not registered , the lesson does not progress . So for any reason, if you desire to disable lesson progression and put the Next and Previous buttons on every lesson , there is an easy code snippet , that can work wonders .

Snippet to Show Next & Previous Button on Lesson

add_filter('learndash_show_next_link', 'learndash_show_next_link_proc', 10, 3);
function learndash_show_next_link_proc( $show_next_link = false, $user_id = 0, $post_id = 0 ) {
    // Example 1) Check if user is admin or group_leader
    if ( ( user_can( $user_id, 'administrator' ) ) || ( user_can( $user_id, 'group_leader' ) ) )
        $show_next_link = true;
    
    // Example 2) Check post type 
    //$post_type = get_post_type( $post_id );
    //if ( $post_type == 'sfwd-lessons') 
    //    $show_next_link = true;

    return $show_next_link;
}

Video on Next & Previous Button on Learndash Lessons