LLMS_Student::is_complete( int $object_id, string $type = 'course' )

Determine if the student has completed a course, track, or lesson


Parameters Parameters

$object_id

(int) (Required) WP Post ID of a course or lesson or section or the term id of the track

$type

(string) (Optional) Object type (course, lesson, section, or track)

Default value: 'course'


Top ↑

Return Return

(boolean)


Top ↑

Source Source

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

		// Check memberships first, it's a faster query.
		if ( $this->get_membership_levels() ) {
			return true;
		}

		// Check for at least one enrolled course.
		$courses = $this->get_courses(
			array(
				'limit'  => 1,
				'status' => 'enrolled',
			)
		);

		if ( $courses['results'] ) {
			return true;
		}

		// Not active.
		return false;

	}

	/**
	 * Determine if the student has completed a course, track, or lesson
	 *
	 * @param    int    $object_id  WP Post ID of a course or lesson or section or the term id of the track
	 * @param    string $type    Object type (course, lesson, section, or track)
	 * @return   boolean
	 * @since    3.0.0


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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