Created
March 23, 2018 13:13
-
-
Save actual-saurabh/c55a0d303f57ee97fa375b61e0c0f874 to your computer and use it in GitHub Desktop.
LifterLMS replace Course Complete with custom link
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
<?php // Do not copy this line | |
// Copy from under this line and paste into your child theme's functions.php | |
add_filter( 'llms_course_continue_button_complete_text', 'my_llms_custom_course_review_link' ); | |
function my_llms_custom_course_review_link(){ | |
// get the current course ID | |
$course_id = get_the_ID(); | |
// all the lessons in the course | |
$lessons = llms_get_post( $course_id )->get_lessons(); | |
// get the first lesson | |
$first_lesson = $lessons[0]; | |
// link to the first lesson | |
$url = get_permalink( $first_lesson->ID ); | |
$link = '<a class="llms-button-primary llms-course-review-button" href="' . $url . '">Review Course</a>'; // Replace Review Course with whatever text you'd like to display | |
return $link; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment