-
Notifications
You must be signed in to change notification settings - Fork 1
List of REST API plugins
We can contribute to WordPress with several useful REST API plugins. This is a list of the current ideas, expected to grow with time:
This plugin has an admin page with a list of custom post types, including posts, pages and attachments. Each custom post type contains a list of custom fields. There is a checkbox to show/hide each custom field in the REST API. There is also a text field to rename the custom field.
This plugin exposes a new endpoint, maybe /wp-json/url-discovery/v1/discover
where you can send a WordPress URL, for example:
https://example.com/wp-json/url-discovery/v1/discover/example.com/my-post
https://example.com/wp-json/url-discovery/v1/discover/example.com/category/my-category
// or maybe...
https://example.com/wp-json/url-discovery/v1/discover?url=https://example.com/my-post
https://example.com/wp-json/url-discovery/v1/discover?url=https://example.com/category/my-category
This endpoint should return the proper content for that url, for example:
-
https://example.com/wp-json/url-discovery/v1/discover?url=https://example.com/my-post
returns the same thanhttps://example.com/wp-json/wp/v2/posts/123
(`my-post' ID is 123). -
https://example.com/wp-json/url-discovery/v1/discover?url=https://example.com/category/my-category
returns the same thanhttps://example.com/wp-json/wp/v2/posts?categories=456
(`my-category' ID is 456).
This plugin sanitizes the content
field with our HTML Purifier.
This plugin adds data-attachment-ids
to images in content. It also adds the proper _links
attribute to get images when _embed
is used. Best if we match it to the WP.com REST API.
This plugin excludes (blacklist) or includes (whitelist) fields from the REST API response. It may work with both query parameters like fields=title,content
and excludeFields=_links
and with an admin interface. Best if we match it to the WP.com REST API.