Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Shortcodes::get_course_id()

Retrieve the course ID from within a course, lesson, or quiz


Return Return

(int)


Top ↑

Source Source

File: includes/shortcodes/class.llms.shortcodes.php

	 */
	private static function get_course_id() {

		$id = get_the_ID();

		if ( is_course() ) {
			return $id;
		}

		$course = llms_get_post_parent_course( $id );
		if ( $course ) {
			return $course->get( 'id' );
		}

		return 0;


Top ↑

Changelog Changelog

Changelog
Version Description
4.0.0 Remove reliance on deprecated class LLMS_Quiz_Legacy.
3.16.0 Unknown.
2.7.9 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.