I'm working on a form for filtering a list of posts using custom fields created with the Advanced Custom Fields plugin. Because of the form, I'm using the
pre_get_posts action to change the query via GET requests. (following code references are either PHP or dumped from
I set the meta_query like this:
$filter looks like this:
Array (  => Array ( [key] => delivery_method [value] => Array (  => Online  => Scheduled ) [compare] => IN ) )
The custom field that I am querying is structured like this:
Array ( [delivery_method] => Array (  => Online  => Scheduled ) )
When I look for posts with
[compare] => IN (as above), no posts are returned. When I look for posts with
[compare] => NOT IN, all of the posts are returned.
I am trying to return only those posts which have a specific "delivery method". Is there a way to compare the two arrays that I missed? or do I have to somehow explode one of the arrays and compare individual values against an array?