1. Home
  2. Knowledge Base
  3. Uncanny LearnDash Toolkit Pro
  4. Reset Button

The LearnDash Reset Button module enables 2 things: a course progress reset button and a course progress reset function (for developers). The button can be displayed with this shortcode or block:

[uo_reset_course_progress course_id="x"]

Block Name: Reset Button

In that example, “x” is the ID for the course, which you can look up by editing your course as an admin and looking at the “post=x” value in the URL. The “x” there is the course ID.

This shortcode or block can be added to any post type, including course post types. When placed on a course page, you do not need to pass in the course ID attribute.

When added (and the module turned on), the button will be shown on a page only if the user viewing the button has some progress recorded for the course. The button will not be displayed if the user hasn’t started the course.

If you want to show the button on a course page and only want to show it when users have completed the course, consider wrapping it in the course_complete shortcode included in LearnDash. See https://support.learndash.com/articles/course_complete/ for more information.

Reset Progress Button modul settings

For even more control over the button, you can click the settings button in the Toolkit Module page to edit the button text and append the name of the course to the button. The latter is helpful if you make multiple buttons available on a single page so users can distinguish them.

Now, for developers that want to use the new course reset function included in this module in other ways, here’s what you need to know to set this up (please note that this is for developer use only):

//Replace with the user ID and course ID combination to be reset
$user_id = 10;
$course_id = 100;
$reset = new \uncanny_pro_toolkit\LearnDashReset();
$reset->reset_course_progress($user_id, $course_id);

Was this article helpful?

0 replies

Comments/Questions

Please note that this is not an official support channel and questions/comments may go unanswered.
To request support, log in to your account and click Submit a Request.

Leave a Reply

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