args
args copied to clipboard
MetaQuery Clauses can contain subclauses
According to the docs, metaquery clauses can be nested.
The example given is (I've reformatted it for readability):
$args = [
'post_type' => 'product',
'meta_query' => [
'relation' => 'OR',
[
'key' => 'color',
'value' => 'orange',
'compare' => '=',
],
[
'relation' => 'AND',
[
'key' => 'color',
'value' => 'red',
'compare' => '=',
],
[
'key' => 'size',
'value' => 'small',
'compare' => '=',
],
],
],
];
$query = new WP_Query( $args );
Can I do this with Args, or is there any plan to support this?
Thanks for the report. This isn't supported by Args, but that's an omission and not intentional. Nesting queries should be doable.