I'm trying to pass an array of values into a meta_query value.
// Works as expected to return posts with 1474 in featured
'meta_query' => array(
array(
'key' => 'featured',
'value' => 1474,
'compare' => 'LIKE'
)
)
// Works as expected to return posts with 2213 in featured
'meta_query' => array(
array(
'key' => 'featured',
'value' => 2213,
'compare' => 'LIKE'
)
)
However when I set as an array it does not work correctly. I am trying to return posts with 'featured' set to either 1474 or 2213.
// Does not work, wp_query returns all posts
'meta_query' => array(
array(
'key' => 'featured',
'value' => array(1474, 2213),
'compare' => 'LIKE'
)
)
I have also changed LIKE to IN with no success. I would like to stay away from multiple meta_query statements as the length of my array may change.
INcompare?featured?