PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.4.1
JetFormBuilder — Dynamic Blocks Form Builder v3.4.1
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 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.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / compatibility / jet-appointment / jet-appointment.php
jetformbuilder / compatibility / jet-appointment Last commit date
assets 2 years ago jet-appointment.php 2 years ago
jet-appointment.php
90 lines
1 <?php
2
3
4 namespace JFB_Compatibility\Jet_Appointment;
5
6 use JFB_Components\Compatibility\Base_Compat_Dir_Trait;
7 use JFB_Components\Compatibility\Base_Compat_Handle_Trait;
8 use JFB_Components\Compatibility\Base_Compat_Url_Trait;
9 use JFB_Components\Module\Base_Module_Dir_It;
10 use JFB_Components\Module\Base_Module_It;
11 use JFB_Components\Module\Base_Module_Handle_It;
12 use JFB_Components\Module\Base_Module_Url_It;
13 use Jet_Form_Builder\Blocks\Module;
14
15 // If this file is called directly, abort.
16 if ( ! defined( 'WPINC' ) ) {
17 die;
18 }
19
20 class Jet_Appointment implements
21 Base_Module_It,
22 Base_Module_Handle_It,
23 Base_Module_Url_It,
24 Base_Module_Dir_It {
25
26 use Base_Compat_Handle_Trait;
27 use Base_Compat_Url_Trait;
28 use Base_Compat_Dir_Trait;
29
30 public function rep_item_id() {
31 return 'jet-appointment';
32 }
33
34 public function condition(): bool {
35 return function_exists( 'jet_apb' );
36 }
37
38 public function init_hooks() {
39 add_action(
40 'wp_enqueue_scripts',
41 array( $this, 'register_scripts' )
42 );
43
44 add_filter(
45 'render_block_jet-forms/appointment-date',
46 array( $this, 'add_compatibility_script' ),
47 10,
48 3
49 );
50 }
51
52 public function remove_hooks() {
53 remove_action(
54 'wp_enqueue_scripts',
55 array( $this, 'register_scripts' )
56 );
57
58 remove_filter(
59 'render_block_jet-forms/appointment-date',
60 array( $this, 'add_compatibility_script' )
61 );
62 }
63
64 public function register_scripts() {
65 $script_asset = require_once $this->get_dir( 'assets/build/frontend.asset.php' );
66
67 array_push(
68 $script_asset['dependencies'],
69 Module::MAIN_SCRIPT_HANDLE,
70 Module::LISTING_OPTIONS_HANDLE
71 );
72
73 wp_register_script(
74 $this->get_handle(),
75 $this->get_url( 'assets/build/frontend.js' ),
76 $script_asset['dependencies'],
77 $script_asset['version'],
78 true
79 );
80 }
81
82 // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
83 public function add_compatibility_script( string $markup, array $parsed, $block ): string {
84 wp_enqueue_script( $this->get_handle() );
85
86 return $markup;
87 }
88
89 }
90