LLMS_Course::is_open()

Determine if students can access course content based on the current date


Description Description

Note that enrollment does not affect the outcome of this check as regardless of enrollment, once a course closes content is locked


Return Return

(boolean)


Top ↑

Source Source

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

	public function is_open() {

		// if a course time period is not enabled, just return true (content is accessible)
		if ( 'yes' !== $this->get( 'time_period' ) ) {

			$ret = true;

		} // End if().
		else {

			$ret = ( $this->has_date_passed( 'start_date' ) && ! $this->has_date_passed( 'end_date' ) );

		}

		return apply_filters( 'llms_is_course_open', $ret, $this );

	}

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.





Permalink: