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

34 lines 832 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 use HelloPlus\Modules\Admin\Classes\Rest\Whats_New;
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 $this->endpoints['whats-new'] = new Whats_New();
30
31 $this->ajax_classes['setup-wizard'] = new Setup_Wizard();
32 }
33 }
34