pre_term_link
Filters the permalink structure for a term before token replacement occurs.
Использование
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(строка)
- The permalink structure for the term's taxonomy.
- $term(WP_Term)
- The term object.
Список изменений
| С версии 4.9.0 | Введена. |
Где вызывается хук
wp-includes/taxonomy.php 4701
$termlink = apply_filters( 'pre_term_link', $termlink, $term );