admin管理员组

文章数量:1278851

A number of properties have been imported from an external API and saved into a custom post type called 'Properties'.

I want to filter these properties by the city they are located in, however it is not as simple as just having a meta key and value I can query.

I have attached an image below of the _addresses key and you can see the value is a nested array and its in here that city is located:

The query I was using is the following with the value missing, I don't think I can just out the city in here, I've tried and it does not work (note I have blanked out the values for confidentiality):

$meta_query[] = [
    'key' => '_addresses',
    'value' => **what goes here?**,
    'compare' => 'in',
];

Any help would be appreciated, thank you.

本文标签: How do i create a custom post query when the meta value is an array