WP_REST_Response::set_matched_route()publicWP 4.4.0

Sets the route (regex for path) that caused the response.

Method of the class: WP_REST_Response{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_REST_Response = new WP_REST_Response();
$WP_REST_Response->set_matched_route( $route );
$route(string) (required)
Route name.

Changelog

Since 4.4.0 Introduced.

WP_REST_Response::set_matched_route() code WP 6.5.2

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