WordPress at Your Fingertips
function is not described

WP_REST_Server::get_route_options() public WP 4.4.0

Retrieves specified options for a route.

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

No Hooks.


Array|null. Data as an associative array if found, or null if not found.


$WP_REST_Server = new WP_REST_Server();
$WP_REST_Server->get_route_options( $route );
$route(string) (required)
Route pattern to fetch options for.

Code of WP_REST_Server::get_route_options() WP 5.8.3

public function get_route_options( $route ) {
	if ( ! isset( $this->route_options[ $route ] ) ) {
		return null;

	return $this->route_options[ $route ];