WordPress at Your Fingertips
function is not described

WP_REST_Request::set_route() public WP 4.4.0

Sets the route that matched the request.

{} It's a method of the class: WP_REST_Request{}

No Hooks.

Return

null. Nothing.

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.

Code of WP_REST_Request::set_route() WP 5.7.2

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