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
版权声明:本文标题:How do i create a custom post query when the meta value is an array? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741247812a2365220.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论