pre_term_link
Filters the permalink structure for a term before token replacement occurs.
Usage
add_filter( 'pre_term_link', 'wp_kama_pre_term_link_filter', 10, 2 ); /** * Function for `pre_term_link` filter-hook. * * @param string $termlink The permalink structure for the term's taxonomy. * @param WP_Term $term The term object. * * @return string */ function wp_kama_pre_term_link_filter( $termlink, $term ){ // filter... return $termlink; }
- $termlink(string)
- The permalink structure for the term's taxonomy.
- $term(WP_Term)
- The term object.
Changelog
Since 4.9.0 | Introduced. |
Where the hook is called
wp-includes/taxonomy.php 4612
$termlink = apply_filters( 'pre_term_link', $termlink, $term );