LLMS_Course::get_prerequisite_id( string $type = 'course' )

Get course’s prerequisite id based on the type of prerequisite


Parameters Parameters

$type

(string) (Optional) Type of prereq to retrieve id for [course|track]. Default is 'course'.

Default value: 'course'


Top ↑

Return Return

(int|false) Post ID of a course, taxonomy ID of a track, or false if none found. .


Top ↑

Source Source

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

	public function get_prerequisite_id( $type = 'course' ) {

		if ( $this->has_prerequisite( $type ) ) {

			switch ( $type ) {

				case 'course':
					$key = 'prerequisite';
					break;

				case 'course_track':
					$key = 'prerequisite_track';
					break;

			}

			if ( isset( $key ) ) {
				return $this->get( $key );
			}
		}

		return false;

	}


Top ↑

Changelog Changelog

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