我正在尝试按语言筛选自定义分类法。为了实现这一点,我使用带有以下参数的WP\\u Query类:
$args = array(
\'post_type\' => [\'post\', \'page\'],
\'post_status\' => \'publish\',
\'lang\' => $language,
\'tax_query\' => array(
array(
\'taxonomy\' => $taxonomy_custom_category,
\'field\' => \'name\',
\'terms\' => $taxonomy_term,
),
),
);
其中$language是检索到的语言之一pll_languages_list()
.但是,除了默认语言之外,查询结果始终为空。是否有任何方法可以使用按语言过滤的多段语言构建表单,以返回自定义分类法的正确结果?