Skip to content

Commit

Permalink
Update PageRestController.php.template
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastou committed Oct 9, 2023
1 parent d22bd58 commit 0d15d3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ class %%pascalCasePageName%%RestController extends BaseRestController
}


}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ class %%pascalCasePageName%%RestController extends PageRestController

// TODO specify your template file name ex: template-home.php
public static $template = "template-xxxx.php";
public static $pageSlug = "%%pageName%%";

public function register_routes():void {
register_rest_route(
$this->namespace . '/v' . $this->version,
'/%%pageName%%',
self::$basePath . self::$pageSlug,
array(
array(
'methods' => \WP_REST_Server::READABLE,
Expand All @@ -28,5 +29,4 @@ class %%pascalCasePageName%%RestController extends PageRestController
public static function format($post): ?array {
return FormatHelper::formatGroup(get_fields($post->ID));
}
}

}

0 comments on commit 0d15d3e

Please sign in to comment.