LLMS_Lab_Course_Continue_Button_Module
LifterLMS Course Continue Button Module class.
Contents
Source Source
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;
}
}
Expand full source code Collapse full source code View on GitHub
Methods Methods
- __construct — Constructor.
- force_display — Force display.
Changelog Changelog
| Version | Description |
|---|---|
| 1.3.0 | Introduced. |