PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.6
JetFormBuilder — Dynamic Blocks Form Builder v3.6.6
3.6.6.1 3.6.6 3.6.5.4 3.6.5.3 3.6.5.2 3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 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 All 134 releases
jetformbuilder / modules / actions-v2 / register-user / register-user.php

register-user.php in JetFormBuilder — Dynamic Blocks Form Builder 3.6.6, at modules/actions-v2/register-user/register-user.php

77 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace JFB_Modules\Actions_V2\Register_User;
4
5 use Jet_Form_Builder\Actions\Manager;
6 use Jet_Form_Builder\Classes\Tools;
7 use JFB_Modules\Actions_V2\Interfaces\Action_Integration_Interface;
8 use JFB_Modules\Actions_V2\Register_User\Messages\Register_User_Messages;
9 use JFB_Modules\Actions_V2\Register_User\Messages\User_Specific_Messages;
10 use JFB_Modules\Actions_V2\Traits\Action_Integration_Trait;
11
12 final class Register_User implements Action_Integration_Interface {
13
14 use Action_Integration_Trait;
15
16 public function rep_item_id() {
17 return 'register-user';
18 }
19
20 public function init_hooks() {
21 add_action(
22 'jet-form-builder/editor-assets/after',
23 array( $this, 'editor_assets' )
24 );
25 add_filter(
26 'jet-form-builder/form-messages/register',
27 array( $this, 'register_message_types' )
28 );
29 }
30
31 public function on_install() {
32 }
33
34 public function register_actions( Manager $manager ) {
35 $manager->register_action_type( new Register_User_Action() );
36 }
37
38 public function register_message_types( array $types ): array {
39 array_push(
40 $types,
41 new User_Specific_Messages(),
42 new Register_User_Messages()
43 );
44
45 return $types;
46 }
47
48 public function editor_assets() {
49 $script_asset = require_once $this->get_dir( 'assets/build/editor.asset.php' );
50
51 array_push(
52 $script_asset['dependencies'],
53 'jet-fb-components',
54 'jet-fb-data',
55 'jet-fb-actions-v2',
56 'jet-fb-blocks-v2-to-actions-v2'
57 );
58
59 wp_enqueue_script(
60 $this->get_handle(),
61 $this->get_url( 'assets/build/editor.js' ),
62 $script_asset['dependencies'],
63 $script_asset['version'],
64 true
65 );
66
67 wp_localize_script(
68 $this->get_handle(),
69 'JetFBRegisterAction',
70 array(
71 'userRoles' => Tools::get_user_roles_for_js(),
72 'allUserRoles' => Tools::get_user_roles_for_js( array() ),
73 )
74 );
75 }
76 }
77