admin管理员组文章数量:1122832
I'm quit new for wordpress development. Working with property management website with mobile API Development.
Here need to filter the data's for based on conditions like greater than and less than & between range.
For example need to filter and search the data's where price filter range and between and greater or less than bedrooms. Kindly help me to solve this issue.I've tried below example but not works to me
http://192.168.0.88:8825/wp-json/wp/v2/properties?filter[meta_key]=property_bathrooms&filter[meta_value]=4&filter[meta_compare]=>=&filter[meta_key]=property_bedrooms&filter[meta_value]=5&filter[meta_compare]=>=&filter[meta_key]=property_price&filter[meta_value]=5,500&filter[meta_compare]=between
I'm quit new for wordpress development. Working with property management website with mobile API Development.
Here need to filter the data's for based on conditions like greater than and less than & between range.
For example need to filter and search the data's where price filter range and between and greater or less than bedrooms. Kindly help me to solve this issue.I've tried below example but not works to me
http://192.168.0.88:8825/wp-json/wp/v2/properties?filter[meta_key]=property_bathrooms&filter[meta_value]=4&filter[meta_compare]=>=&filter[meta_key]=property_bedrooms&filter[meta_value]=5&filter[meta_compare]=>=&filter[meta_key]=property_price&filter[meta_value]=5,500&filter[meta_compare]=between
Share
Improve this question
asked May 7, 2016 at 11:14
sankar muniyappasankar muniyappa
532 silver badges9 bronze badges
0
1 Answer
Reset to default 0Using meta_key
and meta_value
are good for filtering a single custom field. But for comparing two fields, you need to construct a meta_query
with your two key/values and a compare
operator.
See this answer which shows the various things you need to do to achieve this.
https://wordpress.stackexchange.com/a/227869/111022
本文标签:
版权声明:本文标题:custom taxonomy - how to filter the data's comparison operators (>= & <=) & range between 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736280972a1926168.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论