wp-rest-api

  • rest_prepare_post to reshape a response

    Removing a field from a core endpoint, or renaming one, has no registration API — the filter on the prepared response is the only hook, and it runs…

  • rest_api_init fires late, and registering early anyway

    rest_api_init only fires on a REST request, which is efficient and means anything registered there does not exist during a normal page load — including the route definitions…

  • The REST API in core, and the plugin it replaces

    4.7 shipped the content endpoints. What moving off the feature plugin involves, why authentication is still the unsolved half, and the read API every site now exposes.

  • permission_callback is not optional

    Omitting permission_callback registers a route that anyone can call. It works, there is no error, and this year there is not even a warning — the notice that…

  • register_rest_route needs the feature plugin until 4.7

    4.4 shipped the REST API infrastructure — the server, the routing, register_rest_route() — and none of the content endpoints. So the function exists on a stock install and…