rest_do_request() WordPress Function
The rest_do_request() function is used to make an HTTP request to a WordPress REST API endpoint. This function is used internally by the WordPress REST API to make requests to registered endpoints.
rest_do_request( WP_REST_Request|string $request ) #
Do a REST request.
Description
Used primarily to route internal requests through WP_REST_Server.
Parameters
- $request
(WP_REST_Request|string)(Required)Request.
Return
(WP_REST_Response) REST response.
Source
File: wp-includes/rest-api.php
function rest_do_request( $request ) { $request = rest_ensure_request( $request ); return rest_get_server()->dispatch( $request ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |