get_terms_fields

过滤钩子


apply_filters( 'get_terms_fields', $selects, $args, $taxonomies )
参数
  • (string[])
    $selects
    An array of fields to select for the terms query.
    Required: 是
  • (array)
    $args
    An array of term query arguments.
    Required: 是
  • (string[])
    $taxonomies
    An array of taxonomy names.
    Required: 是
定义位置
  • wp-includes/class-wp-term-query.php
    , line 699
引入
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.

$fields = implode( ', ', apply_filters( 'get_terms_fields', $selects, $args, $taxonomies ) );