How to Get a Connected Course by Lesson ID

Lesson Attachments

Lessons are connected to courses by storing the course ID in each lesson’s post meta using the key “wpc-connected-lesson-to-course.”

$lesson_id = 29;
$course_id = get_post_meta( $lesson_id, 'wpc-connected-lesson-to-course', true );