WP_REST_Server::get_route_options()
Retrieves specified options for a route.
Method of the class: WP_REST_Server{}
No Hooks.
Return
Array|null
. Data as an associative array if found, or null if not found.
Usage
$WP_REST_Server = new WP_REST_Server(); $WP_REST_Server->get_route_options( $route );
- $route(string) (required)
- Route pattern to fetch options for.
Changelog
Since 4.4.0 | Introduced. |
WP_REST_Server::get_route_options() WP REST Server::get route options code WP 6.7.1
public function get_route_options( $route ) { if ( ! isset( $this->route_options[ $route ] ) ) { return null; } return $this->route_options[ $route ]; }