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)
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; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.5.1 | Introduced. |