LLMS_Track::get_courses()
Get an array of WP Posts for the courses in the track
Contents
Return Return
(array)
Source Source
File: includes/class.llms.track.php
public function get_courses() {
// No posts in the term, return an empty array.
if ( 0 === $this->term->count ) {
return array();
}
$q = new WP_Query(
array(
'post_status' => 'publish',
'post_type' => 'course',
'posts_per_page' => -1,
'tax_query' => array(
array(
'field' => 'id',
'include_children' => false,
'taxonomy' => $this->taxonomy,
'terms' => $this->term->term_id,
),
),
)
);
if ( $q->have_posts() ) {
return $q->posts;
} else {
return array();
}
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |