如何在WP_query
中为过滤器语言设置语言参数?
'suppress_filters' => 0
无效。
$query = new WP_Query(array(
'post_type' => 'apre_restaurants',
'posts_per_page' => -1,
'post_status' => 'publish'
));
答案 0 :(得分:0)
尝试以下脚本
$args = array( 'posts_per_page' => -1, 'tax_query' => array( array( 'taxonomy' => 'include custom taxonomy name', 'field' => 'id', 'terms' => function_exists('icl_object_id')?icl_object_id($categoryID,'include custom taxonomy name',false):$categoryID ) ), 'suppress_filters' => 0 ); //(do not forget 'suppress_filters' => 0) :)