我试图抓住“状态”和“所有”键,来自请求的URL的值,并且无法弄清楚如何构建我的类对象。 我所指的JSON API规范可以在这里找到: http://jsonapi.org/recommendations/#filtering // requested url
/api/endpoint?filter[status]=all
// my attempt at model binding
我想从帖子类型=事件获取帖子,但未显示来自帖子帖子类型的正确帖子,但是来自实际WP-POST <?php
// Get the JSON
$json = file_get_contents('http://coralgableschamber.org/wp-json/posts?filter[posts_per_page]=1&filter[post_type]=events