fields=id,title.rendered,link
as GET parameter)
{
"id": 2138,
"link": "http://worldofict.nl/tip/2138-rechtenvrije-fotos/",
"title": {
"rendered": "Rechtenvrije foto’s"
}
}
笔记
rest api filter fields
and press install.
Or download it right from Github and copy the rest-api-filter-fields
directory in the archive to wp-content/plugins/
.No, this plugin only removes entries. When you want to add featured_images, I recommend using better-rest-api-featured-images
You can filter on nested properties with a '.' like 'title.rendered'. Not sure if this also works on arrays. Existing issues or Submit issue
Yes, we picked 20 as priority (default = 10) for activating. This mean this plugin is probably activated last, so all custom post types should already be loaded. But this only works if you made it public for the api. See Adding REST API Support for Custom Content Types for more information.
All the bugs/issues are maintained on github.com/svrooij/rest-api-filter-fields so please create an issue (or a pull request with a fix) there.
_embed
GET parameter!)._links
field doesn't get stripped anymore.first
, like _embedded.author.first.name
.