get_terms_fields хук-фильтр . WP 2.8.0
Filters the fields to select in the terms query.
Field lists modified using this filter will only modify the term fields returned by the function when the $fields parameter set to 'count' or 'all'. In all other cases, the term fields in the results array will be determined by the $fields parameter alone.
Use of this filter can result in unpredictable behavior, and is not recommended.
Использование
add_filter( 'get_terms_fields', 'filter_function_name_6308', 10, 3 ); function filter_function_name_6308( $selects, $args, $taxonomies ){ // filter... return $selects; }
- $selects(строка[])
- An array of fields to select for the terms query.
- $args(массив)
- An array of term query arguments.
- $taxonomies(строка[])
- An array of taxonomy names.
Список изменений
С версии 2.8.0 | Введена. |
Где вызывается хук
wp-includes/class-wp-term-query.php 648
$fields = implode( ', ', apply_filters( 'get_terms_fields', $selects, $args, $taxonomies ) );