Change Courses Slug to Training
-
Hello,
I’d like to change the “courses” slug to “training.” I’ve tried a few methods, but when I click on a lesson, the “courses” slug appears.
This code works on a courses page, but when I enter the course in a lesson or quiz, it shows the “courses” slug.
add_filter( 'register_post_type_args', 'tf_register_post_type_args', 10, 2 ); function tf_register_post_type_args( $args, $post_type ) { if ( 'courses' === $post_type ) { $args['rewrite']['slug'] = 'training'; } elseif ( 'lesson' === $post_type ) { $args['rewrite']['slug'] = 'test1'; } elseif ( 'tutor_quiz' === $post_type ) { $args['rewrite']['slug'] = 'test2'; } return $args; }I tried this and it does not work at all:
add_filter('tutor_courses_base_slug', 'change_tutor_course_slug'); add_filter('tutor_lesson_base_slug', 'change_tutor_course_slug'); add_filter('tutor_quiz_base_slug', 'change_tutor_course_slug'); /** * @param $slug * @return string */ function change_tutor_course_slug($slug) { $slug = "training"; return $slug; }Any ideas on how to fix this?
Thank you!
Jake
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Change Courses Slug to Training’ is closed to new replies.