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

Output the widget


Parameters Parameters

$args

(array) (Required) arguments passed to the widget

$instance

(array) (Required) instance information


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/widgets/class.llms.bbp.widget.course.forums.list.php

	public function widget( $args, $instance ) {

		$id = get_the_ID();
		if ( 'course' !== get_post_type( $id ) ) {
			$course = llms_get_post_parent_course( $id );
		} else {
			$course = llms_get_post( $id );
		}

		if ( ! $course ) {
			return;
		}

		if ( ! $course->get( 'bbp_forum_ids' ) ) {
			return;
		}

		echo $args['before_widget'];

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

			echo do_shortcode( '[lifterlms_bbp_course_forums]' );

		echo $args['after_widget'];

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.12.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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