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'
Return Return
(int|false) Post ID of a course, taxonomy ID of a track, or false if none found. .
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; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.7.3 | Unknown. |
3.0.0 | Introduced. |