LLMS_Student::get_next_lesson( int $course_id )

Get the next lesson a student needs to complete in a course

Parameters Parameters


(int) (Required) WP_Post ID of the course

Top ↑

Return Return

(int) WP_Post ID of the lesson or false if all courses are complete

Top ↑

Source Source

File: includes/models/model.llms.student.php

	public function get_next_lesson( $course_id ) {

		$course  = new LLMS_Course( $course_id );
		$lessons = $course->get_lessons( 'ids' );

		foreach ( $lessons as $lesson ) {
			if ( ! $this->is_complete( $lesson, 'lesson' ) ) {
				return $lesson;

		return false;


Top ↑

Changelog Changelog

Version Description
3.0.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.