LLMS_Course::get_lessons( string $return = 'lessons' )
Get course lessons
Parameters Parameters
- $return
-
(string) (Optional) Type of return [ids|posts|lessons]. Default is 'lessons'.
Default value: 'lessons'
Return Return
(int[]|WP_Post[]|LLMS_Lesson[]) The type depends on value of $return
.
Source Source
File: includes/models/model.llms.course.php
} if ( 'ids' === $return ) { $ret = wp_list_pluck( $lessons, 'ID' ); } elseif ( 'posts' === $return ) { $ret = $lessons; } else { $ret = array_map( 'llms_get_post', $lessons ); } return $ret; } /** * Retrieve the number of course's lessons. * * This is less expensive than counting the result of {@see LLMS_Course::get_lessons()},
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.24.0 | Unknown. |
3.0.0 | Introduced. |