PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.56
Timetics – Appointment Booking Calendar & Scheduling v1.0.56
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.56, at base/custom-endpoint.php

55 lines 986 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
9 defined( 'ABSPATH' ) || exit;
10
11 use Timetics\Utils\Singleton;
12
13 class Custom_Endpoint {
14 use Singleton;
15
16 /**
17 * Initialize
18 *
19 * @return void
20 */
21 public function init() {
22 add_action( 'init', [$this, 'register'] );
23 }
24
25 /**
26 * Register all custom endpoints
27 *
28 * @return void
29 */
30 public function register() {
31 $endpoints = $this->get_endpoints();
32
33 foreach ( $endpoints as $endpoint ) {
34 add_rewrite_endpoint( $endpoint, EP_ALL );
35 }
36
37 // Flush rewrite rules after register all custom endpoints.
38 flush_rewrite_rules( true );
39 }
40
41 /**
42 * Get all endpoints
43 *
44 * @return array
45 */
46 public function get_endpoints() {
47 /**
48 * All endpoints that have to be register
49 */
50 return [
51 'timetics-integration',
52 ];
53 }
54 };
55