admin管理员组文章数量:1134557
I am pulling in some data via the Rest API:
[]=3116&include[]=3249&include[]=3170&include[]=3416&include[]=3181&include[]=1857&include[]=3563
The data loads fine, but the order is out of whack.
I was expecting the first result to be ID '3116' as that's the first included id in my URL.
How do I pull in data orderd by the URL id?
I am pulling in some data via the Rest API:
https://example.com/wp-json/wp/v2/speaker?include[]=3116&include[]=3249&include[]=3170&include[]=3416&include[]=3181&include[]=1857&include[]=3563
The data loads fine, but the order is out of whack.
I was expecting the first result to be ID '3116' as that's the first included id in my URL.
How do I pull in data orderd by the URL id?
Share Improve this question edited Oct 31, 2023 at 19:03 Keith asked May 9, 2019 at 11:51 KeithKeith 1,5664 gold badges17 silver badges21 bronze badges1 Answer
Reset to default 2Add orderby=include
to your GET request.
See the docs here:
https://developer.wordpress.org/rest-api/reference/posts/#arguments
本文标签: How to order WordPress Rest API data
版权声明:本文标题:How to order WordPress Rest API data 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736762005a1951602.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论