LLMS_Lab_Course_Continue_Button_Module

LifterLMS Course Continue Button Module class.


Source Source

File: includes/beaver-builder/modules/course-continue-button/class.llms.lab.course.continue.button.module.php

class LLMS_Lab_Course_Continue_Button_Module extends FLBUilderModule {

	/**
	 * Constructor.
	 *
	 * @since 1.3.0
	 * @since 1.7.0 Escape strings.
	 *
	 * @return void
	 */
	public function __construct() {
		parent::__construct(
			array(
				'name'          => esc_html__( 'Course Continue Button', 'lifterlms' ),
				'description'   => esc_html__( 'Displays a course progress bar for the current course.', 'lifterlms' ),
				'category'      => esc_html__( 'LifterLMS Modules', 'lifterlms' ),
				'dir'           => LLMS_BB_MODULES_DIR . 'course-continue-button/',
				'url'           => LLMS_BB_MODULES_URL . 'course-continue-button/',
				'editor_export' => false,
				'enabled'       => true,
			)
		);

		add_filter( 'llms_course_continue_button_next_lesson', array( $this, 'force_display' ) );
	}

	/**
	 * Force display.
	 *
	 * @since 1.7.0
	 *
	 * @param int $lesson_id WP_Post ID of the lesson.
	 * @return int
	 */
	public function force_display( $lesson_id ) {

		if ( ! $lesson_id && FLBuilderModel::is_builder_active() ) {
			return get_the_ID();
		}

		return $lesson_id;
	}
}

Top ↑

Methods Methods


Top ↑

Changelog Changelog

Changelog
Version Description
1.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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