PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.49
Timetics – Appointment Booking Calendar & Scheduling v1.0.49
1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 All 62 releases
timetics / base / custom-endpoint.php

custom-endpoint.php in Timetics – Appointment Booking Calendar & Scheduling 1.0.49, at base/custom-endpoint.php

52 lines 954 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Register Custom Endpoint
4 *
5 * @package Timetics
6 */
7 namespace Timetics\Base;
8 use Timetics\Utils\Singleton;
9
10 class Custom_Endpoint {
11 use Singleton;
12
13 /**
14 * Initialize
15 *
16 * @return void
17 */
18 public function init() {
19 add_action( 'init', [$this, 'register'] );
20 }
21
22 /**
23 * Register all custom endpoints
24 *
25 * @return void
26 */
27 public function register() {
28 $endpoints = $this->get_endpoints();
29
30 foreach ( $endpoints as $endpoint ) {
31 add_rewrite_endpoint( $endpoint, EP_ALL );
32 }
33
34 // Flush rewrite rules after register all custom endpoints.
35 flush_rewrite_rules( true );
36 }
37
38 /**
39 * Get all endpoints
40 *
41 * @return array
42 */
43 public function get_endpoints() {
44 /**
45 * All endpoints that have to be register
46 */
47 return [
48 'timetics-integration',
49 ];
50 }
51 };
52