move restAPI class to utilities
This commit is contained in:
@@ -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 ],
|
||||||
@@ -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');
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user