[
'post_type' => ['post', 'event'],
'meta_query' => [
'relation' => 'AND',
[
'key' => 'crb_pinned_enabled',
'value' => 'yes' // boolean
],
[
'relation' => 'OR', // <- nested OR relation is not possible to set
[
'key' => 'crb_pinned_until',
'value' => '', // date, when field not set, keep pinned forever
'compare' => '='
],
[
'key' => 'crb_pinned_until',
'value' => date('Y-m-d'), // today's not included
'compare' => '>',
'type' => 'DATETIME'
]
]
],
]
Allowing even one extra meta query level in UI would probably help in many cases without being too crazy to implement. Compare type used in example is also impossible but created another issue for it #99.
Example WP_Query args that is not possible to achieve in the current block UI:
Allowing even one extra meta query level in UI would probably help in many cases without being too crazy to implement. Compare type used in example is also impossible but created another issue for it #99.