如果您正在从术语slug、特定分类法中寻找特定的术语对象,我认为new WP_Term_Query() 是您的最佳选择:
$term_args = array(
\'taxonomy\' => \'category\',
\'name\' => array( \'accessibility\',\'wcag\', \'abc\' )
\'hide_empty\' => false,
\'fields\' => \'all\',
\'count\' => true,
);
$term_query = new WP_Term_Query($term_args);
foreach($term_query->terms as $term){
echo \'<pre>\';
print_r($term); // You\'ll see the term object here, which is what I think you are after
echo \'</pre>\';
}