This plugin helps you to make WordPress REST endpoints in a simpler and cleaner way.
Go to your WordPress plugin folder and clone this repo.
git clone git@github.com:suomato/simpler-rest-router.git
- Activate
Simpler Rest Router
plugin. - Copy and paste code from
_boilerplate.php
to yourfunction.php
file. - Define your route. (Docs are included with boilerplate).
If you want better and cleaner code structure, define your route in a separate file and require that file in
functions.php
file.