-
-
Save bernhardkaindl/721dcb376b394717e8c035c2164efd22 to your computer and use it in GitHub Desktop.
Tutor LMS - Redirect user to lesson page directly
This file contains hidden or 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. | |
*/ |
Sorry, this gist is a fork from https://gist.github.com/creativeartbd/45917fdda38ca6741cdb172dfb6e41e4, I didn't use it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! I'm trying to do this but i cant see that line of code in the enrolled courses.php, can you please help me?