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
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.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: