PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.59
Timetics – Appointment Booking Calendar & Scheduling v1.0.59
1.0.64 1.0.62 1.0.63 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 All 65 releases
timetics / vendor / themewinter / uninstaller_form / src / HookRegistrar.php

HookRegistrar.php in Timetics – Appointment Booking Calendar & Scheduling 1.0.59, at vendor/themewinter/uninstaller_form/src/HookRegistrar.php

59 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace UninstallerForm;
3
4 use ReflectionMethod;
5 use UninstallerForm\Api\FeedbackController;
6 use UninstallerForm\Support\Localizer;
7
8 /**
9 * HookRegistrar class for the uninstaller form.
10 *
11 * @since 1.0.0
12 *
13 * @package UNINSTALLER_FORM
14 */
15 class HookRegistrar {
16 protected $plugin_name, $plugin_slug, $plugin_file, $plugin_text_domain, $script_handler,$webhook;
17
18 /**
19 * HookRegistrar Constructor.
20 *
21 * @param string $plugin_name The name of the plugin.
22 * @param string $plugin_slug The slug of the plugin.
23 * @param string $plugin_file The path to the plugin file.
24 * @param string $plugin_text_domain The text domain of the plugin.
25 * @param string $script_handler The handle of the script to enqueue.
26 *
27 * @since 1.0.0
28 */
29 public function __construct($plugin_name, $plugin_slug, $plugin_file, $plugin_text_domain, $script_handler,$webhook='') {
30 $this->plugin_name = $plugin_name;
31 $this->plugin_slug = $plugin_slug;
32 $this->plugin_file = $plugin_file;
33 $this->plugin_text_domain = $plugin_text_domain;
34 $this->script_handler = $script_handler;
35 $this->webhook = $webhook;
36 }
37
38 /**
39 * Register hooks for the uninstaller form.
40 *
41 * @since 1.0.0
42 *
43 * @return void
44 */
45 public function register() {
46 add_action('rest_api_init', function () {
47 $reflection = new ReflectionMethod(FeedbackController::class, '__construct');
48 $totalParams = $reflection->getNumberOfParameters();
49 if( $totalParams === 5){
50 new FeedbackController($this->plugin_file,$this->plugin_text_domain, $this->plugin_name, $this->plugin_slug,$this->webhook);
51 }
52 });
53
54 add_action('admin_enqueue_scripts', function () {
55 $localizer = new Localizer($this->plugin_name, $this->plugin_text_domain, $this->plugin_file, $this->script_handler);
56 $localizer->handle();
57 });
58 }
59 }