LLMS_Course::has_prerequisite( string $type = 'any' )

Determine if prerequisites are enabled and there are prereqs configured


Parameters Parameters

$type

(string) (Optional) Determine if a specific type of prereq exists [any|course|track].

Default value: 'any'


Top ↑

Return Return

(boolean) Returns true if prereq is enabled and there is a prerequisite course or track.


Top ↑

Source Source

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

		// 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 );

	}

	/**
	 * Determine if prerequisites are enabled and there are prereqs configured
	 *
	 * @since 3.0.0
	 * @since 3.7.5 Unknown.


Top ↑

Changelog Changelog

Changelog
Version Description
3.7.5 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.