Warning: This method has been deprecated.

LLMS_AJAX::get_lessons_alt()

Return custom array of lessons for use on the engagement page


Description Description


Return Return

(array) Array of lessons


Top ↑

Source Source

File: includes/class.llms.ajax.php

	public function get_lessons_alt() {

		llms_deprecated_function( 'LLMS_AJAX::get_lessons_alt()', '3.13.0' );

		$args = array(
			'post_type' 	=> 'lesson',
			'nopaging' 		=> true,
			'post_status'   => 'publish',

		 );

		$lessons = get_posts( $args );

		$options = array();

		if ( ! empty( $lessons ) ) {

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

				//get parent course if assigned
				$parent_course = get_post_meta( $value->ID, '_llms_parent_course', true );

				if ( $parent_course ) {
					$title = $value->post_title . ' ( ' . get_the_title( $parent_course ) . ' )';
				} else {
					$title = $value->post_title . ' ( ' . __( 'unassigned', 'lifterlms' ) . ' )';
				}

				$options[] = array(
					'ID' 		 => $value->ID,
					'post_title' => $title,
				);

			}
		}

		echo json_encode( $options );

		wp_die();
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.13.0 This method has been deprecated.
1.3.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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