ACFV1.php
3 years ago
CountLayoutInstall.php
3 years ago
ElImport.php
3 years ago
FrontEndFilterV1.php
3 years ago
GetPostsV1.php
3 years ago
ImageSizeV1.php
3 years ago
RestApi.php
3 years ago
RttpgV1.php
3 years ago
ImageSizeV1.php
25 lines
| 1 | <?php |
| 2 | |
| 3 | namespace RT\ThePostGrid\Controllers\Api; |
| 4 | |
| 5 | use RT\ThePostGrid\Helpers\Fns; |
| 6 | |
| 7 | class ImageSizeV1{ |
| 8 | public function __construct(){ |
| 9 | add_action("rest_api_init", [$this, 'register_image_size_route']); |
| 10 | } |
| 11 | |
| 12 | public function register_image_size_route(){ |
| 13 | register_rest_route( 'rttpg/v1', 'image-size',array( |
| 14 | 'methods' => 'GET', |
| 15 | 'callback' => [$this, 'get_image_sizes'], |
| 16 | 'permission_callback' => function() { return true; } |
| 17 | )); |
| 18 | } |
| 19 | |
| 20 | public function get_image_sizes(){ |
| 21 | $data = Fns::get_all_image_sizes_guten(); |
| 22 | return rest_ensure_response($data); |
| 23 | } |
| 24 | |
| 25 | } |