Last active
October 17, 2024 11:38
-
-
Save creativeartbd/45917fdda38ca6741cdb172dfb6e41e4 to your computer and use it in GitHub Desktop.
Tutor LMS - Redirect user to lesson page directly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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
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?