LLMS_Shortcodes::course_info( array $atts )

Output various pieces of metadata about a course


Description Description


Parameters Parameters

$atts

(array) (Required) array of user-submitted shortcode attributes


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/shortcodes/class.llms.shortcodes.php

	public static function course_info( $atts ) {
		extract( shortcode_atts( array(
			'date_format' => 'F j, Y', // if $type is date, a custom date format can be supplied
			'id' => get_the_ID(),
			'key' => '',
			'type' => '', // date, price
		), $atts, 'lifterlms_course_info' ) );

		$ret = '';

		if ( $key ) {

			$course = new LLMS_Course( $id );

			switch ( $type ) {

				case 'date':
					$ret = $course->get_date( $key, $date_format );
				break;

				case 'price':
					$ret = $course->get_price( $key );
				break;

				default:
					$ret = $course->get( $key );

			}
		}

		return apply_filters( 'llms_shortcode_course_info', $ret, $atts );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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