Site Overlay

Set the Course Progression conditionally for specific users.

Linear Progression in LearnDash forces users to consume your course content lesson by lesson. They cannot skip through the lessons.

Let’s say you have a course with Linear progression. All enrollees are forced to access the content in this way.

But what if you want to allow a small and specific set of users to hop through the lessons freely?

You can conditionally set the Course Progression to Free Form for some specific users.

Create a Group to hold the ‘Free Form’ allowed users.

Grab the Group ID.

Add any relevant users to the Group.

Grab the Course ID.

Add the following snippet to your theme’s functions.php:

add_filter('learndash_course_progression_enabled', function($setting, $course_id){

return learndash_is_user_in_group(get_current_user_id(), GROUP_ID) && $course_id == COURSE_ID ? false : $setting;

}, 10, 2);

Ensure to replace GROUP_ID with the actual ID of the Group and COURSE_ID with the real ID of the Course you want to apply this condition.

In the logic above, the learndash_course_progression_enabled filter expects a boolean value.

To allow free form, we need to force the returned value to false when the condition matches.

NOTE: It is NOT required to add the Course to the Group.

The Group is used to identify the users who should be allowed free-form progression instead of linear progression.

Check the documentation links below:

Leave a Reply

Your email address will not be published. Required fields are marked *