PluginProbe
Hello Plus / trunk
Hello Plus vtrunk
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.7.0 1.7.1 1.7.2 1.7.3 All 30 releases
hello-plus / modules / admin / components / api-controller.php

api-controller.php in Hello Plus trunk, at modules/admin/components/api-controller.php

36 lines 968 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace HelloPlus\Modules\Admin\Components;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 use HelloPlus\Modules\Admin\Classes\Ajax\Blank_Canvas_Option;
10 use HelloPlus\Modules\Admin\Classes\Ajax\Setup_Wizard;
11 use HelloPlus\Modules\Admin\Classes\Rest\Onboarding_Settings;
12 use HelloPlus\Modules\Admin\Classes\Rest\Whats_New;
13
14 class Api_Controller {
15
16 protected $endpoints = [];
17
18 protected $ajax_classes = [];
19
20 public function get_endpoint( string $endpoint ) {
21 if ( ! isset( $this->endpoints[ $endpoint ] ) ) {
22 throw new \Exception( esc_html__( 'Endpoint not found', 'hello-plus' ) );
23 }
24
25 return $this->endpoints[ $endpoint ];
26 }
27
28 public function __construct() {
29 $this->endpoints['onboarding-settings'] = new Onboarding_Settings();
30 $this->endpoints['whats-new'] = new Whats_New();
31
32 $this->ajax_classes['setup-wizard'] = new Setup_Wizard();
33 $this->ajax_classes['blank-canvas-option'] = new Blank_Canvas_Option();
34 }
35 }
36