move restAPI class to utilities

This commit is contained in:
2025-12-19 12:28:59 +00:00
parent 39444a6898
commit 3d51f8f735
2 changed files with 7 additions and 6 deletions

View File

@@ -1,8 +1,8 @@
<?php <?php
namespace App\API; namespace App\Utilities;
class Admin class RestAPI
{ {
public function __construct() public function __construct()
{ {
@@ -11,16 +11,18 @@ class Admin
public function blocks( ) public function blocks( )
{ {
register_rest_route('badegg/v1', '/blocks/container_width', [ $restBase = 'badegg/v1';
register_rest_route($restBase, '/blocks/container-widths', [
'methods' => 'GET', 'methods' => 'GET',
'callback' => [ $this, 'container_width'], 'callback' => [ $this, 'containerWidths'],
'permission_callback' => function(){ 'permission_callback' => function(){
return true; return true;
}, },
]); ]);
} }
public function container_width() public function containerWidths()
{ {
$containerWidths = [ $containerWidths = [
[ 'label' => __('Auto', 'badegg'), 'value' => 0 ], [ 'label' => __('Auto', 'badegg'), 'value' => 0 ],

View File

@@ -57,7 +57,6 @@ autoload_psr4('PostTypes');
autoload_psr4('ACF'); autoload_psr4('ACF');
autoload_psr4('Utilities'); autoload_psr4('Utilities');
autoload_psr4('Admin'); autoload_psr4('Admin');
autoload_psr4('API');
/* /*