I am trying to build a query that returns all posts, with a meta value that exists in a set of values.
My posts have a meta key called Asin_unique
and I want to find all posts, that have the value B006MWDNVI
,B00BCMCIS2
, or B01ARRJFGA
in this field.
This is what I have built so far, but it only returns me the post with B00BCMCIS2
, not the other ones. What do I have to change to make it work?
$args = array(
'post_status' => 'any',
'post_type' => 'any',
'numberposts' => -1,
'meta_query' => array(
array(
'key' => 'Asin_unique',
'value' => '(B006MWDNVI,B00BCMCIS2,B01ARRJFGA)',
'compare' => 'IN',
)
)
);
$posts = get_posts( $args );