LLMS_Widget_Course_Progress::widget( array $args, array $instance )

Front-end display of widget


Description Description

See also See also


Top ↑

Parameters Parameters

$args

(array) (Required) Widget arguments.

$instance

(array) (Required) Saved values from database.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/widgets/class.llms.widget.course.progress.php

	public function widget( $args, $instance ) {

		$check_enrollment = ( ! isset( $instance['check_enrollment'] ) ) ? 1 : $instance['check_enrollment'];
		$course_progress  = do_shortcode( '[lifterlms_course_progress check_enrollment=' . $check_enrollment . ']' );

		// Do not show the widget title if no progress bar is displayed.
		if ( empty( $course_progress ) ) {
			return;
		}

		echo $args['before_widget'];

		if ( ! empty( $instance['title'] ) ) {
			echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];
		}

		echo $course_progress;

		echo $args['after_widget'];
	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.38.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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