term_links-(taxonomy)
Filters the term links for a given taxonomy.
The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
Possible hook names include:
term_links-categoryterm_links-post_tagterm_links-post_format
Использование
add_filter( 'term_links-(taxonomy)', 'wp_kama_term_links_taxonomy_filter' );
/**
* Function for `term_links-(taxonomy)` filter-hook.
*
* @param string[] $links An array of term links.
*
* @return string[]
*/
function wp_kama_term_links_taxonomy_filter( $links ){
// filter...
return $links;
}
- $links(string[])
- An array of term links.
Список изменений
| С версии 2.5.0 | Введена. |
Где вызывается хук
wp-includes/category-template.php 1375
$term_links = apply_filters( "term_links-{$taxonomy}", $links ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores