get_terms хук-фильтр . WP 2.3.0
Filters the found terms.
Использование
add_filter( 'get_terms', 'filter_function_name_3401', 10, 4 ); function filter_function_name_3401( $terms, $taxonomies, $args, $term_query ){ // filter... return $terms; }
- $terms(массив)
- Array of found terms.
- $taxonomies(массив)
- An array of taxonomies.
- $args(массив)
- An array of get_terms() arguments.
- $term_query(WP_Term_Query)
- The WP_Term_Query object.
Список изменений
С версии 2.3.0 | Введена. |
С версии 4.6.0 | Added the $term_query parameter. |
Где вызывается хук
get_terms
wp-includes/taxonomy.php 1247
return apply_filters( 'get_terms', $terms, $term_query->query_vars['taxonomy'], $term_query->query_vars, $term_query );
Где используется хук в ядре WordPress
wp-includes/default-filters.php 505
add_filter( 'get_terms', '_post_format_get_terms', 10, 3 );