There's a custom post type called "events" and another post type called "venues". The post type "events" has a relation field for "venues" so that the user can select the venue when setting up an event.
"venue" has a custom text field "city".
I need now to search for all events that are in a specific city. With meta_query it doesn't work, the results are always empty:
$query->set('meta_query', array(
array(
'key' => 'city',
'value' => 'New York',
'compare' => 'LIKE',
),
));
How can I find all events where the city of the connected venue is equal to "New York"? Thanks a lot!