Skip to content

Commit 34069bc

Browse files
committed
Add 5.0 changelog to REST API handbook changelog page
1 parent 722962a commit 34069bc

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

changelog.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
This document details changes to the WP REST API since its public release in version 4.7.0.
44

5+
## Version 5.0
6+
7+
- New Routes & Endpoints
8+
- Introduce `wp/v2/search` route implementing a new `WP_REST_Search_Controller`. Search types are handled by extending `WP_REST_Search_Handler`, and the active search type may be filtered using the `wp_rest_search_handlers` filter. [#39965](https://core.trac.wordpress.org/ticket/39965)
9+
- Introduce `wp/v2/blocks` route to retrieve individual reusable blocks. Requires authentication. [#45098](https://core.trac.wordpress.org/ticket/45098)
10+
- Introduce autosaves endpoints for all post types except `attachment`. Autosaves endpoints utilize the new `WP_REST_Autosaves_Controller` class, and saves only the `id`, `title`, `post_content` and `excerpt` for a post. Autosaves are enabled even for post types which do not support revisions. Requires authentication. [#43316](https://core.trac.wordpress.org/ticket/43316)
11+
- Introduce `wp/v2/block-renderer/<name>` routes to return dynamically generated markup for server-rendered blocks. The `name` component of the URL is structured as `namespace/block-id`, _e.g._ `core/archives`. Requires authentication. [#45098](https://core.trac.wordpress.org/ticket/45098)
12+
- Introduce `wp/v2/themes` endpoint to expose supported theme features to the block editor. This endpoint only returns data for the active theme. Requires authentication. [#45016](https://core.trac.wordpress.org/ticket/45016)
13+
- Introduce `wp/v2/types/wp_block` endpoint to expose block labels and capabilities relating to the new hidden post type `wp_block`. [#45098](https://core.trac.wordpress.org/ticket/45098)
14+
- Additional Changes
15+
- Custom taxonomies must specify `show_in_rest` as `true` to be visible in the block editor.
16+
- Introduce `wp_is_json_request()` function to detemine if request is expecting a JSON response, and contextually silence PHP warnings if so. [r43730](https://core.trac.wordpress.org/changeset/43730)
17+
- Requests to public, viewable post types specifying the `edit` context now return two additional properties, `permalink_temlate` and `generated_slug`. [r43720](https://core.trac.wordpress.org/changeset/43720)
18+
- Respect the `?_fields=` filter when applying custom post properties with `register_rest_field`. [r43736](https://core.trac.wordpress.org/changeset/43736)
19+
- Permit users with `read_private_posts` capability to query for private posts. [r43694](https://core.trac.wordpress.org/changeset/43694)
20+
- Declare the `unfiltered_html` capability using JSON Hyper Schema `targetSchema`. [r43682](https://core.trac.wordpress.org/changeset/43682)
21+
- Introduce `block_version` property on the post object to denote the presence and version of blocks within the post. [r43770](https://core.trac.wordpress.org/changeset/43770)
22+
- Add new `rest_after_*` action hooks that fire after all write operations have completed. [r42864](https://core.trac.wordpress.org/changeset/42864)
23+
- See [The REST API in WordPress 5.0](https://make.wordpress.org/core/2018/12/06/the-rest-api-in-wordpress-5-0/) for further commentary.
24+
525
## Version 4.9.8
626

727
- Add an `object_subtype` argument to the `$args` parameter for `register_meta()`: this parameter allows developers to specify the object subtypes (_i.e._ specific post types or taxonomies) for which the registered meta will appear when `show_in_rest` is true. Introduce new wrapper methods `register_post_meta()` and `register_term_meta()` which are recommended instead of `register_meta` when working with post or term meta. [r43378](https://core.trac.wordpress.org/changeset/43378)

index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ If you want a structured, extensible, and simple way to get data in and out of W
1818

1919
For all of its simplicity the REST API can feel quite complex at first, so in this handbook we will attempt to break it down into smaller components to explain each part of the full puzzle.
2020

21-
2221
## Key Concepts
2322

2423
To get started we will break down some of the key concepts and terms associated with the REST API: **Routes & Endpoints,** **Requests**, **Responses**, **Schema**, and **Controller Classes**. Each of these concepts play a crucial role in understanding, using, and extending the WordPress REST API, and each is explored in greater depth within this handbook.
@@ -54,7 +53,10 @@ Each endpoint requires a particular structure of input data, and returns data us
5453

5554
Controller classes unify and coordinate all these various moving parts within a REST API response cycle. With a controller class you can manage the registration of routes & endpoints, handle requests, utilize schema, and generate API responses. A single class usually contains all of the logic for a given route, and a given route usually represents a specific type of data object within your WordPress site (like a custom post type or taxonomy).
5655

57-
5856
## Next Steps
5957

60-
For a comprehensive overview of the resources and routes available within the default WordPress REST API, review the [API reference](https://developer.wordpress.org/rest-api/reference/). To learn more about how to interact with API resources, you can read through the [Using the REST API section](https://developer.wordpress.org/rest-api/using-the-rest-api/). Once you're comfortable with the default workings of the default routes and methods you may also dive in to how to [extend the REST API](https://developer.wordpress.org/rest-api/extending-the-rest-api/) to expose new data or enhance and manipulate existing response objects.
58+
Learn more about how to interact with API resources and query for specific data in the [Using the REST API](https://developer.wordpress.org/rest-api/using-the-rest-api/) section.
59+
60+
Once you're comfortable with the default workings of the default routes and methods, discover how to add new data to the API or enhance and manipulate existing response objects in the [Extending the REST API](https://developer.wordpress.org/rest-api/extending-the-rest-api/) section.
61+
62+
For a comprehensive overview of the resources and routes available by default, review the [API reference](https://developer.wordpress.org/rest-api/reference/).

0 commit comments

Comments
 (0)