I have this query in wordpress
$args['orderby'] = 'rand';
$args['order'] = '';
$args['meta_key'] = '_wc_pre_orders_enabled';
$args['meta_value'] = 'no';
$args['meta_compare'] = '=';
What I need is that wordpress filter by the meta key _wc_pre_orders_enabled and that the value is no or null
Just display those results but currently it doesn't work.
What am I doing wrong?
Edit: I also tried this way but it's not working.
Apparently meta_query is not happening.
$args = array(
'orderby' => 'rand',
'order' => '',
'meta_query' => array(
array(
'key' => '_wc_pre_orders_enabled',
'value' => array('no',''),
'compare' => 'IN'
)
)
);