string $termlink, WP_Term $term, string $taxonomy )
Filters the term link.
Term link URL.
This filter is applied to the link URL for a term prior to printing by the function get_term_link() .
View all references
return apply_filters( 'term_link', $termlink, $term, $taxonomy );
Example migrated from Codex:
Append a hashbang at the end of the url.
If you are using a solution to keep same slug for both custom post type and taxonomies, such like:
You should follow those steps to make it working:
1. Register taxonomy course_category with rewrite slug = ‘course-category’.
2. Register post type course with rewrite slug ‘course’.
2. Add filter to term_link:
Remember to flush permalink once to apply changes (on Settings / Permalinks).