我不知道有哪些现成的函数支持这一点,但您可以轻松构建WP_Term_Query
这样做。以下代码未经测试,但应能正常工作:
$args = [
\'description__like\' => \'the description you\\\'re searching for\',
\'taxonomy\' => \'category\',//or other taxonomy
\'fields\' => \'ids\',
\'hide_empty\' => false,
];
$term_query = new WP_Term_Query($args);
foreach ($term_query->terms as $term) {
// ID is in $term->term_id
}