Adding Custom Course Statuses in WPLMS

From version 1.8.4, course statuses are stored in a custom user meta field called :course_status123 where 123 is the course id of the respective course.

The course statuses follows :
STATUS : 1 : START COURSE
STATUS : 2 : CONTINUE COURSE
STATUS : 3 : FINISH COURSE : COURSE UNDER EVALUATION
STATUS : 4 : COURSE EVALUATED

Above 1,2,3,4 are reserved status values for the theme.

The theme also has the flexibility to allow for unlimited course statuses. Course statuses can be used in a course for various custom functionality.

Check below example on how to user Custom Course Statuses in WPLMS :

Let us add a new course status when user completes a course 50%, we’ll use this Course status to display the take course button text as Half way through

1. Adding function on hook : badgeos_wplms_unit_complete

Add this code in WPLMS Customizer -> customizer_class.php
in __construct function

add_filter(‘badgeos_wplms_unit_complete’,array($th is,’custom _course_status’),10,3);

In Class :

PHP Code:

2. Displaying new information in Credits :

in __construct function
add_filter(‘wplms_course_credits’,array($this,’cus tom_wplms_course_credits’),10,2);

In class

PHP Code:

3. Display new label in the button :

in __construct function
add_filter(‘wplms_default_course_button’,array($th is,’custom_wplms_default_course_button’),10,3);

​In class

PHP Code:

 

Was this article helpful?

Related Articles