WP_REST_Request::set_route() WordPress Method
The WP_REST_Request::set_route() method is used to set the route for a given request. This is typically used when registering a new route with the WP_REST_Server class.
WP_REST_Request::set_route( string $route ) #
Sets the route that matched the request.
Parameters
- $route
(string)(Required)Route matching regex.
Source
File: wp-includes/rest-api/class-wp-rest-request.php
public function set_route( $route ) { $this->route = $route; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |