LLMS_Course::has_capacity()

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


Return Return

(boolean) Returns 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.15.0 Unknown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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