Endpoints will take a single parameter, as opposed to the previous version. The endpoint in question is WP_REST_Request
. The argument registration has been transferred to route registration, and argument options are set to a default value.
Register_rest_route
will now help with route registration, but requires the use of a namespace. It is used with the plugin slug along the plugin version like sowp/v2
.Built-in endpoints will now make use of a typical controller base class, which has its standardized pattern. In version 2, this changed to become a public API for developers, and the recommendation is that this is applied when working with most use cases. While it is not mandatory in custom code, it will just embody best practices in the core of the API.
Callbacks with permissions will now be registered in a separate manner towards the response callback, which will allow better capability assertions for clients.
The server will now sanitize and validate arguments for us by...