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.


Top ↑

Source

File: wp-includes/rest-api/class-wp-rest-request.php

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


Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.