llms_get_post_parent_course( mixed $post )
Retrieve the parent course for a section, lesson, or quiz
Description Description
Parameters Parameters
- $post
-
(mixed) (Required) WP Post ID or instance of WP_Post
Return Return
(obj|null) Instance of the LLMS_Course or null
Source Source
File: includes/llms.functions.core.php
function llms_get_post_parent_course( $post ) { $post = llms_get_post( $post ); $post_types = apply_filters( 'llms_course_children_post_types', array( 'section', 'lesson', 'llms_quiz' ) ); if ( ! $post || ! in_array( $post->get( 'type' ), $post_types ) ) { return null; } return $post->get_course(); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: