Skip to content

Instantly share code, notes, and snippets.

@creativeartbd
Last active October 17, 2024 11:38
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.
*/
@karlaoviedo21
Copy link

Hello! i really need to set this redirection but i cant find the code that you mentioned in that route wp-content/plugins/tutor/templates/dashboard/enrolled-courses.php at line number 39, can you please help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment