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'
Return Return
(boolean)
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
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |