Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Analytics_Lessoncompletions_Widget::get_lesson_ids( array $products )

Retrieve an array of lesson ids for all the products in the current filter

Parameters Parameters


(array) (Required) array of product ids

Top ↑

Return Return


Top ↑

Source Source

File: includes/admin/reporting/widgets/

	private function get_lesson_ids( $products ) {

		$lessons = array();

		// Loop through all products.
		foreach ( $products as $product ) {

			// Ignore the memberships.
			if ( 'llms_membership' === get_post_type( $product ) ) {

			// Get the course.
			$course  = llms_get_post( $product );
			$lessons = array_merge( $course->get_lessons( 'ids' ) );


		return $lessons;


Top ↑

Changelog Changelog

Version Description
3.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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