WP_REST_Navigation_Fallback_Controller::register_routes
Registers the controllers routes.
Method of the class: WP_REST_Navigation_Fallback_Controller{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WP_REST_Navigation_Fallback_Controller = new WP_REST_Navigation_Fallback_Controller(); $WP_REST_Navigation_Fallback_Controller->register_routes();
Changelog
| Since 6.3.0 | Introduced. |
WP_REST_Navigation_Fallback_Controller::register_routes() WP REST Navigation Fallback Controller::register routes code WP 7.0
public function register_routes() {
// Lists a single nav item based on the given id or slug.
register_rest_route(
$this->namespace,
'/' . $this->rest_base,
array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_item' ),
'permission_callback' => array( $this, 'get_item_permissions_check' ),
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::READABLE ),
),
'schema' => array( $this, 'get_item_schema' ),
)
);
}