From b16580cf4dc428c2b4d9216176e73b0b617bd91d Mon Sep 17 00:00:00 2001 From: Zaidfahd654 <93848535+Zaidfahd654@users.noreply.github.com> Date: Mon, 12 Jan 2026 01:12:44 +0530 Subject: [PATCH] Clarify REST API introduction in documentation Reworded the introduction to the REST API section for clarity. --- rest-api/routes-endpoints/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest-api/routes-endpoints/index.md b/rest-api/routes-endpoints/index.md index fce3823..35551cd 100644 --- a/rest-api/routes-endpoints/index.md +++ b/rest-api/routes-endpoints/index.md @@ -1,6 +1,6 @@ # Routes & Endpoints -The REST API provides us a way to match URIs to various resources in our WordPress install. By default, if you have pretty permalinks enabled, the WordPress REST API “lives” at `/wp-json/`. At our WordPress site `https://ourawesomesite.com`, we can access the REST API’s index by making a `GET` request to `https://ourawesomesite.com/wp-json/`. The index provides information regarding what routes are available for that particular WordPress install, along with what HTTP methods are supported and what endpoints are registered. +The REST API provides a way to match URIs to various resources in our WordPress installation. By default, if you have pretty permalinks enabled, the WordPress REST API “lives” at `/wp-json/`. At our WordPress site `https://ourawesomesite.com`, we can access the REST API’s index by making a `GET` request to `https://ourawesomesite.com/wp-json/`. The index provides information regarding what routes are available for that particular WordPress install, along with what HTTP methods are supported and what endpoints are registered. If we wanted to create an endpoint that would return the phrase “Hello World, this is the WordPress REST API”, we would first need to register the route for that endpoint. To register routes you should use the `register_rest_route()` function. It needs to be called on the `rest_api_init` action hook. `register_rest_route()` handles all of the mapping for routes to endpoints. Let’s try to create a “Hello World, this is the WordPress REST API” route.