Created
February 5, 2020 12:43
-
-
Save pavlo-bondarchuk/1055e87e3304e26f01432d35a8366e71 to your computer and use it in GitHub Desktop.
Hide Course complete button until complete all lessons in Tutor LMS
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
| /** | |
| * Hide Course complete button until complete all lessons in Tutor LMS | |
| * | |
| */ | |
| add_filter('tutor_course/single/complete_form', 'tutor_lms_hide_course_complete_btn'); | |
| function tutor_lms_hide_course_complete_btn($html){ | |
| $completed_lesson = tutils()->get_completed_lesson_count_by_course(); | |
| $lesson_count = tutils()->get_lesson_count_by_course(); | |
| if ($completed_lesson < $lesson_count){ | |
| return ''; | |
| } | |
| return $html; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment