-
-
Save bernhardkaindl/721dcb376b394717e8c035c2164efd22 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