In this last part of our tutorial series on WP REST API, we will be looking at how the internals of the WP REST API work and modifying server responses for our default endpoints to contain custom fields.
WP REST API has two main categories of classes, and those are endpoint and infrastructure classes. The endpoint classes cover the CRUD actions over resources like posts and comments that we overviewed in the last chapter. The infrastructure classes are covering classes that lie at the foundation of the API. In the following example, we will be looking at each of those two classes in detail.
The endpoint classes within the WP REST API are responsible for performing actions of creating, reading, updating and deleting, which include different controllers like the
WP_REST_Posts_Controller and various others that are united within a more general class named
This patterned class that provides the...