Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nayeemch/e3578dca25e827de7a6abf2eebd0da6a to your computer and use it in GitHub Desktop.
Save nayeemch/e3578dca25e827de7a6abf2eebd0da6a to your computer and use it in GitHub Desktop.
This code will help you to change base slug `courses` to your preferred slug, replace `example-course-slug` with your own slug.
add_filter('tutor_courses_base_slug', 'change_tutor_course_slug');
/**
* @param $slug
* @return string
*/
if ( ! function_exists('change_tutor_course_slug')){
function change_tutor_course_slug($slug){
$slug = 'example-course-slug';
return $slug;
}
}
@bernhardkaindl
Copy link

Try this, it should work better: https://github.com/martinmaiolo/tutor-LMS/blob/main/tutor-lms-change-default-course-base-slug

add_filter('tutor_courses_base_slug', 'change_tutor_course_slug');
/**
 * @param $slug
 * @return string
 */
if ( ! function_exists('change_tutor_course_slug')){
    function change_tutor_course_slug($slug){
        $slug = 'example-course-slug';
        return $slug;
    }
}

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