REST Tests
Code testing various aspects of WordPress's REST API.
by Keiran Pillman · github.com/keircatenation/rest-tests · website
★ 1stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/keircatenation/rest-tests/archive/refs/heads/main.zipDeclares an update source (https://github.com/keircatenation/rest-tests), so updates arrive through the plugin's own updater.
From the readme
More than an Extension: Customizing the WordPress REST API
Keiran Pillman
Webmaster, Memorial Art Gallery of the University of Rochester
Digital Collegium Pennsylvania Regional Conference, June 2025
1. Basics
2. Modifying It
3. D.I.Y. It
4. References
Basics of WordPress's REST API
WordPress's REST API was started as a plugin, but was fully integrated into core with 4.7 in 2016. It's the foundation of the block editor, enables useage of WordPress as a headless CMS, and its ability to be modified allows for custom routes and endpoints that can do quite a bit more.
Content that is public on your site is generally publicly accessible via the REST API, while private content, password-protected content, internal users, custom post types, and metadata is only available with authentication or if you specifically set it to be so.
Terminology
- A route is the name used to access an endpoint; the URI that can be mapped to different HTTP methods
- An endpoint is the function called when an individual HTTP method is called on a route
- A namespace is a way to group routes
- A request is an instance of the WPRESTRequest class, which stores and retrieves information for the current request
-