WP_REST_Request::get_route()publicWP 4.4.0

Retrieves the route that matched the request.

Method of the class: WP_REST_Request{}

No Hooks.

Return

String. Route matching regex.

Usage

$WP_REST_Request = new WP_REST_Request();
$WP_REST_Request->get_route();

Changelog

Since 4.4.0 Introduced.

WP_REST_Request::get_route() code WP 6.6.2

public function get_route() {
	return $this->route;
}