PluginProbe
Hello Plus / 1.2.0
Hello Plus v1.2.0
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 1.2.0, at modules/admin/components/api-controller.php

33 lines 730 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\Setup_Wizard;
10 use HelloPlus\Modules\Admin\Classes\Rest\Onboarding_Settings;
11
12
13 class Api_Controller {
14
15 protected $endpoints = [];
16
17 protected $ajax_classes = [];
18
19 public function get_endpoint( string $endpoint ) {
20 if ( ! isset( $this->endpoints[ $endpoint ] ) ) {
21 throw new \Exception( esc_html__( 'Endpoint not found', 'hello-plus' ) );
22 }
23
24 return $this->endpoints[ $endpoint ];
25 }
26
27 public function __construct() {
28 $this->endpoints['onboarding-settings'] = new Onboarding_Settings();
29
30 $this->ajax_classes['setup-wizard'] = new Setup_Wizard();
31 }
32 }
33