name/v$this->version", $this->endpoint . '/learn', [ [ 'methods' => \WP_REST_Server::READABLE, 'callback' => function () { return rest_ensure_response( LearnScriptsController::bootData() ); }, // Same capability the learn admin route requires. 'permission_callback' => function () { return current_user_can( 'manage_options' ); }, ], ] ); } }