我目前正在使用以下方法从自定义分类中获取数据:
$terms = get_terms(array(
\'taxonomy\' => \'my_custom_taxonomy_name\',
\'hide_empty\' => true
));
现在,这在每个
WP_Term 对象
term_id,
name,
slug,
term_group,
term_taxonomy_id,
taxonomy,
description,
parent,
count 和
filter.
我只需要得到其中的两个:name 和slug. 如何过滤该查询,使其不会返回所有未使用的数据?