问题是模棱两可,你不能\'relation\' => \'OR\'
在主参数列表中,因为WP_Query
知道是不是为了tax_query
而不是meta_query
?
它应该如何工作,以及relation
我们需要参考的参数the official docs for WP_Query
这给了我们一个例子:
$args = array(
\'post_type\' => \'post\',
\'tax_query\' => array(
\'relation\' => \'OR\',
array(
\'taxonomy\' => \'category\',
\'field\' => \'slug\',
\'terms\' => array( \'quotes\' ),
),
array(
\'taxonomy\' => \'post_format\',
\'field\' => \'slug\',
\'terms\' => array( \'post-format-quote\' ),
),
),
);
$query = new WP_Query( $args );
设置它可能非常简单:
$myarray[\'relation\'] = \'OR\'; // untested