LLMS_Course::has_capacity()

Determine if the course is at capacity based on course capacity settings


Description Description


Return Return

(boolean) true if not at capacity, false if at or over capacity


Top ↑

Source Source

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

	public function has_capacity() {

		// capacity disabled, so there is capacity
		if ( 'yes' !== $this->get( 'enable_capacity' ) ) {
			return true;
		}

		$capacity = $this->get( 'capacity' );
		// no capacity restriction set, so it has capacity
		if ( ! $capacity ) {
			return true;
		}

		// compare results
		return ( $this->get_student_count() < $capacity );

	}

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: