rest_namespace, '/' . $this->rest_base, [ 'methods' => 'GET', 'callback' => [$this, 'handle'], 'permission_callback' => [$this, 'can_use'], ] ); } public function handle(WP_REST_Request $request): WP_REST_Response { return new WP_REST_Response( [ 'ok' => true, 'namespace' => $this->rest_namespace, 'time' => current_time('mysql'), ], 200 ); } }