PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.4.7
JetFormBuilder — Dynamic Blocks Form Builder v3.4.7
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 / modules / actions-v2 / module.php
jetformbuilder / modules / actions-v2 Last commit date
assets 1 year ago call-hook 1 year ago call-webhook 1 year ago get-response 1 year ago insert-post 1 year ago interfaces 1 year ago mailchimp 1 year ago redirect-to-page 1 year ago register-user 1 year ago send-email 1 year ago traits 1 year ago update-user 1 year ago .eslintrc.js 1 year ago module.php 1 year ago
module.php
132 lines
1 <?php
2
3 namespace JFB_Modules\Actions_V2;
4
5 use Jet_Form_Builder\Actions\Manager;
6 use JFB_Components\Module\Base_Module_After_Install_It;
7 use JFB_Components\Module\Base_Module_Dir_It;
8 use JFB_Components\Module\Base_Module_Dir_Trait;
9 use JFB_Components\Module\Base_Module_Handle_It;
10 use JFB_Components\Module\Base_Module_Handle_Trait;
11 use JFB_Components\Module\Base_Module_It;
12 use JFB_Components\Module\Base_Module_Url_It;
13 use JFB_Components\Module\Base_Module_Url_Trait;
14 use JFB_Components\Repository\Interfaces\Repository_Pattern_Interface;
15 use JFB_Components\Repository\Repository_Pattern_Trait;
16 use JFB_Modules\Actions_V2\Interfaces\Action_Integration_Interface;
17
18 final class Module implements
19 Base_Module_It,
20 Base_Module_Handle_It,
21 Base_Module_Url_It,
22 Base_Module_Dir_It,
23 Base_Module_After_Install_It,
24 Repository_Pattern_Interface {
25
26 use Base_Module_Url_Trait;
27 use Base_Module_Handle_Trait;
28 use Base_Module_Dir_Trait;
29 use Repository_Pattern_Trait;
30
31 public function rep_item_id() {
32 return 'actions-v2';
33 }
34
35 public function rep_instances(): array {
36 return array(
37 new Send_Email\Send_Email(),
38 new Insert_Post\Insert_Post(),
39 new Register_User\Register_User(),
40 new Update_User\Update_User(),
41 new Redirect_To_Page\Redirect_To_Page(),
42 new Call_Hook\Call_Hook(),
43 new Call_Webhook\Call_Webhook(),
44 new Mailchimp\Mailchimp(),
45 new Get_Response\Get_Response(),
46 );
47 }
48
49 public function on_install() {
50 $this->rep_install();
51
52 /** @var Action_Integration_Interface $integration_item */
53 foreach ( $this->rep_generate_items() as $integration_item ) {
54 $integration_item->on_install();
55 }
56 }
57
58 public function on_uninstall() {
59 $this->rep_clear();
60 }
61
62 public function condition(): bool {
63 return true;
64 }
65
66 public function init_hooks() {
67 add_action( 'jet-form-builder/actions/register', array( $this, 'register_actions' ) );
68
69 add_action(
70 'enqueue_block_editor_assets',
71 array( $this, 'register_assets' ),
72 -9
73 );
74 add_action(
75 'wp_enqueue_scripts',
76 array( $this, 'register_assets' ),
77 -9
78 );
79
80 /** @var Action_Integration_Interface $integration_item */
81 foreach ( $this->rep_generate_items() as $integration_item ) {
82 $integration_item->init_hooks();
83 }
84 }
85
86
87 public function remove_hooks() {
88 remove_action( 'jet-form-builder/actions/register', array( $this, 'register_actions' ) );
89
90 remove_action(
91 'enqueue_block_editor_assets',
92 array( $this, 'register_assets' ),
93 -9
94 );
95 remove_action(
96 'wp_enqueue_scripts',
97 array( $this, 'register_assets' ),
98 -9
99 );
100 }
101
102
103 public function register_actions( Manager $manager ) {
104 /** @var Action_Integration_Interface $integration_item */
105 foreach ( $this->rep_generate_items() as $integration_item ) {
106 $integration_item->register_actions( $manager );
107 }
108 }
109
110 public function register_assets() {
111 $script_asset = require_once $this->get_dir( 'assets/build/editor.asset.php' );
112
113 if ( true === $script_asset ) {
114 return;
115 }
116
117 array_push(
118 $script_asset['dependencies'],
119 'jet-fb-components',
120 'jet-fb-data'
121 );
122
123 wp_register_script(
124 $this->get_handle(),
125 $this->get_url( 'assets/build/editor.js' ),
126 $script_asset['dependencies'],
127 $script_asset['version'],
128 true
129 );
130 }
131 }
132