LLMS_Lesson::is_orphan()
Determine if the lesson is an orphan
Description Description
Return Return
(bool)
Source Source
File: includes/models/model.llms.lesson.php
public function is_orphan() { $statuses = array( 'publish', 'future', 'draft', 'pending', 'private', 'auto-draft' ); foreach ( array( 'course', 'section' ) as $parent ) { $parent_id = $this->get( sprintf( 'parent_%s', $parent ) ); if ( ! $parent_id ) { return true; } elseif ( ! in_array( get_post_status( $parent_id ), $statuses ) ) { return true; } } return false; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.14.8 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: