PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.4
JetFormBuilder — Dynamic Blocks Form Builder v3.6.4
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 1.1.2 1.1.3 1.1.4 1.1.5 All 130 releases
jetformbuilder / modules / actions-v2 / insert-post / insert-post.php
insert-post.php
54 lines 1.2 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\Insert_Post;
4
5 use Jet_Form_Builder\Actions\Manager;
6 use JFB_Modules\Actions_V2\Interfaces\Action_Integration_Interface;
7 use JFB_Modules\Actions_V2\Traits\Action_Integration_Trait;
8
9 class Insert_Post implements Action_Integration_Interface {
10
11 use Action_Integration_Trait;
12
13 public function rep_item_id() {
14 return 'insert-post';
15 }
16
17 public function init_hooks() {
18 require_once $this->get_dir( 'traits/process-meta-boxes-trait.php' );
19
20 add_action(
21 'jet-form-builder/editor-assets/after',
22 array( $this, 'editor_assets' )
23 );
24 }
25
26 public function on_install() {
27 // TODO: Implement on_install() method.
28 }
29
30 public function register_actions( Manager $manager ) {
31 $manager->register_action_type( new Insert_Post_Action() );
32 }
33
34 public function editor_assets() {
35 $script_asset = require_once $this->get_dir( 'assets/build/editor.asset.php' );
36
37 array_push(
38 $script_asset['dependencies'],
39 'jet-fb-components',
40 'jet-fb-data',
41 'jet-fb-actions-v2',
42 'jet-fb-blocks-v2-to-actions-v2'
43 );
44
45 wp_enqueue_script(
46 $this->get_handle(),
47 $this->get_url( 'assets/build/editor.js' ),
48 $script_asset['dependencies'],
49 $script_asset['version'],
50 true
51 );
52 }
53 }
54