Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zgordon/b290842a35ac462d4387c6735b1a7bc2 to your computer and use it in GitHub Desktop.
Save zgordon/b290842a35ac462d4387c6735b1a7bc2 to your computer and use it in GitHub Desktop.
This hook let's you redirect to a custom page when a LearnDash course is completed.
<?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);
?>
@stringhamschools2016
Copy link

Can this be revised to redirect a lesson?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment