@@ -25,7 +25,7 @@ function bootstrap() {
2525 // REST API integration.
2626 add_filter ( 'rest_authentication_errors ' , __NAMESPACE__ . '\\Authentication \\maybe_report_errors ' );
2727 add_filter ( 'rest_index ' , __NAMESPACE__ . '\\register_in_index ' );
28- add_action ( 'rest_api_init ' , __NAMESPACE__ . '\\register_routes ' );
28+ add_action ( 'rest_api_init ' , __NAMESPACE__ . '\\Endpoints \\ register ' );
2929
3030 // Internal default hooks.
3131 add_filter ( 'oauth2.grant_types ' , __NAMESPACE__ . '\\register_grant_types ' , 0 );
@@ -40,6 +40,7 @@ function load() {
4040 require __DIR__ . '/inc/class-client.php ' ;
4141 require __DIR__ . '/inc/class-scopes.php ' ;
4242 require __DIR__ . '/inc/authentication/namespace.php ' ;
43+ require __DIR__ . '/inc/endpoints/namespace.php ' ;
4344 require __DIR__ . '/inc/endpoints/class-authorization.php ' ;
4445 require __DIR__ . '/inc/endpoints/class-token.php ' ;
4546 require __DIR__ . '/inc/tokens/namespace.php ' ;
@@ -129,11 +130,6 @@ function register_in_index( WP_REST_Response $response ) {
129130 return $ response ;
130131}
131132
132- function register_routes () {
133- $ token_endpoint = new Endpoints \Token ();
134- $ token_endpoint ->register_routes ();
135- }
136-
137133/**
138134 * Get the authorization endpoint URL.
139135 *
0 commit comments