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')