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'


Top ↑

Return Return

(int[]|WP_Post[]|LLMS_Lesson[]) The type depends on value of $return.


Top ↑

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()},


Top ↑

Changelog Changelog

Changelog
Version Description
3.24.0 Unknown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.