WP Rest API:最新帖子的详细信息,包括一个请求中的特色媒体网址?
我正在使用wp-rest api来获取帖子信息。我还使用wp rest api过滤器项过滤字段并汇总结果: 当我调用http://example.com/wp-json/wp/v2/posts?items=id,title,featured_media它时,返回的结果如下: [ { "id": 407, "title": { "rendered": "Title 1" }, "featured_media": 399 }, { "id": 403, "title": { "rendered": "Title 2" }, "featured_media": 401 } ] 问题是如何使用此ID生成特色媒体网址?默认情况下,调用会http://example.com/wp-json/wp/v2/media/401返回一个新的json,其中包含有关不同大小的源图片网址的所有详细信息: { "id": 401, "date": "2016-06-03T17:29:09", "date_gmt": "2016-06-03T17:29:09", "guid": { "rendered": "http://example.com/wp-content/uploads/my-image-name.png" }, "modified": "2016-06-03T17:29:09", "modified_gmt": "2016-06-03T17:29:09", "slug": "my-image-name", …