rest_do_request( WP_REST_Request|string $request )
Do a REST request.
Description Description
Used primarily to route internal requests through WP_REST_Server.
Parameters Parameters
- $request
-
(WP_REST_Request|string) (Required) Request.
Return Return
(WP_REST_Response) REST response.
Source 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 code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
rest_do_request
can be used to internally send a REST API request and return the response object for it. You need to create the Request object first.Expand full source codeCollapse full source code