Filters the term link.
Parameters
$termlinkstring- Term link URL.
$termWP_Term- Term object.
$taxonomystring- Taxonomy slug.
Source
return apply_filters( 'term_link', $termlink, $term, $taxonomy );
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |
Filters the term link.
$termlinkstring$termWP_Term$taxonomystringreturn apply_filters( 'term_link', $termlink, $term, $taxonomy );
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
If you are using a solution to keep same slug for both custom post type and taxonomies, such like:
/course/course-name
/course/course-category-name
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).
Example migrated from Codex:
Append a hashbang at the end of the url.