This hook let's you redirect to a custom page when a LearnDash course is completed.
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 | |
function custom_course_completed_redirect($link, $course_id) { | |
$link = get_post_field( 'post_name', $course_id ); | |
//You can change the link here | |
return '/congrats/' . $link; | |
} | |
add_filter("learndash_course_completion_url", custom_course_completed_redirect, 5, 2); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can this be revised to redirect a lesson?