namespace . $this->getRoute( $path ) ); } /** * Gets route. * * @param string $path Short relative URL path. */ public function getRoute( string $path ): string { return "/{$this->restBase}{$path}"; } /** * Register route. * * @param string $path Short relative URL path. * @param array $params Route configuration. */ public function registerRoute( string $path, array $params ): void { register_rest_route( $this->namespace, $this->getRoute( $path ), $params ); } }