Redirecting to Lessons for Enrolled Courses

In a student’s frontend dashboard, they can find all courses that they are enrolled in the “Enrolled Courses” tab. When the student clicks on a course, it takes them to the course landing page.
Instead, if you want to redirect the student directly to the first lesson, you can use this process:

Go to wp-content/plugins/tutor/templates/dashboard/enrolled-courses.php. Here you will see this code:

$custom_url = home_url($post->post_type.'/'.$post->post_name)

After this line, add this code:

$lesson_url = tutor_utils()->get_course_first_lesson( get_the_ID() );
$lesson_url = $lesson_url ? $lesson_url : $custom_url;

Now, replace the $custom_url variable found after this line in your enrolled-courses.php file, with $lesson_url so that when you click on the title it will directly go to the lesson instead of the course page.

Was this helpful?