Skip to content

Instantly share code, notes, and snippets.

@creativeartbd
Last active July 13, 2023 16:12
Show Gist options
  • Save creativeartbd/45917fdda38ca6741cdb172dfb6e41e4 to your computer and use it in GitHub Desktop.
Save creativeartbd/45917fdda38ca6741cdb172dfb6e41e4 to your computer and use it in GitHub Desktop.
Tutor LMS - Redirect user to lesson page directly
/*
On the Enrolled Course page, You can see all the enrolled courses, right? Now, if you click on the title of the course you will be redirected to the course page.
Okay, but if you want to redirect the user to the first lesson of any course then what? Well, use this code:
Go to wp-content/plugins/tutor/templates/dashboard/enrolled-courses.php at line number 39. Here you can 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() );
/*
Now, Replace the $custom_url with $lesson_url so that when you click on the title it will directly go to the lesson instead of the course page.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment