The real power of REST API comes with the usage of custom routes and endpoints. There are certain limitations in adjusting existing routes and endpoints to our requirements. In some scenarios, we may have to create our own classes and extend the WordPress core classes to achieve custom functionality. So, custom routes and endpoints allow us to implement custom REST API features with minimum work, without interfering with WordPress core REST API features.
In this section, we are going to implement the following features to learn the basics of custom REST API routes and endpoints:
- Disable the default post endpoint and use custom routes to expose posts only in selected categories with selected post data ...