get_lesson_data( $lessons )

Returns post array of data for lessons associated with a course


Description Description


Parameters Parameters

(array) (Required)


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/llms.template.functions.php

function get_lesson_data( $lessons ) {
	global $post;
	$html = '';
	$args = array(
		'post_type'   => 'lesson',
		'post_status' => 'publish',
		'nopaging'    => true,
	);

	$lessons_query = get_posts( $args );

	$array = array();

	foreach ( $lessons as $key => $value ) :

		foreach ( $lessons_query as $lesson ) :

			if ( $value == $lesson->ID ) {
				$array[ $value ] = $lesson;
			}

		endforeach;

	endforeach;

	return $array;
}

Top ↑

User Contributed Notes User Contributed Notes

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