assets
1 year ago
properties
1 year ago
insert-term-action.php
1 year ago
insert-term.php
1 year ago
insert-term.php
54 lines
| 1 | <?php |
| 2 | |
| 3 | namespace JFB_Modules\Actions_V2\Insert_Term; |
| 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_Term implements Action_Integration_Interface { |
| 10 | |
| 11 | use Action_Integration_Trait; |
| 12 | |
| 13 | public function rep_item_id() { |
| 14 | return 'insert-term'; |
| 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_Term_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 |