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.
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 );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.15.0 | Unknown. |
| 3.0.0 | Introduced. |