WP_REST_Request::set_route()publicWP 4.4.0

Sets the route that matched the request.

Method of the class: WP_REST_Request{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_REST_Request = new WP_REST_Request();
$WP_REST_Request->set_route( $route );
$route(string) (required)
Route matching regex.

Changelog

Since 4.4.0 Introduced.

WP_REST_Request::set_route() code WP 6.5.2

public function set_route( $route ) {
	$this->route = $route;
}