Categories
October Surprise 2024

How to create your own REST routes in WordPress

WordPress makes registering custom rest routes really easy with a function called register_rest_route. This function provides options to create a namespace (which you can also use to version your APIs), all of your route names, an args array to create CRUD operations and check security, and even set your route to override or merge with existing routes. Function definition Let’s review the …