From 64aa61c1e466dac2895b0e9610b0e1ccf48bab39 Mon Sep 17 00:00:00 2001 From: carlos Date: Thu, 18 Feb 2021 14:05:21 +0000 Subject: [PATCH] generate() fix. --- src/Generator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generator.php b/src/Generator.php index 2b60475..8b9c191 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -118,7 +118,7 @@ public function generate() { ->addComment("Controller class for callbacks and permissions.\nRoute --> " . sprintf($this->config->getPsr() . '\%s', ucfirst($this->endpoint))) ->addComment('@since ' . $this->config->getVersion()); - foreach ($method as $function) { + foreach ($this->method as $function) { $function = $class->addMethod(strtolower($function) . ucfirst($this->endpoint)) ->addComment('Handles ' . $function . ' requests to the endpoint.') ->addComment('@return \WP_Rest_Response')