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_Shortcode_Course_Outline::get_course_id()

Retrieve the default course id depending on the current post


Return Return

(int|null)


Top ↑

Source Source

File: includes/shortcodes/class.llms.shortcode.course.outline.php

	private function get_course_id() {

		global $post;
		$post_id = isset( $post->ID ) ? $post->ID : null;

		$course_id = null;

		if ( $post_id ) {

			if ( 'course' !== $post->post_type ) {

				// get the parent
				$parent = llms_get_post_parent_course( $post );
				if ( $parent ) {
					$course_id = $parent->get( 'id' );
				}
			} else {

				$course_id = $post_id;

			}
		}

		return $course_id;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.5.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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