PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.2.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.2.2
V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 2.10.2 All 137 releases
bit-form / includes / Widgets / RegisterBitFormElementorWidget.php

RegisterBitFormElementorWidget.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 3.2.2, at includes/Widgets/RegisterBitFormElementorWidget.php

42 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 BitCode\BitForm\Widgets;
4
5 if (!defined('ABSPATH')) {
6 exit;
7 }
8
9 class RegisterBitFormElementorWidget
10 {
11 public function __construct()
12 {
13 add_action('elementor/widgets/register', [$this, 'register_widgets']);
14 add_action('elementor/editor/after_save', [$this, 'clearElementorCache']);
15 add_action('update_option_elementor_css', [$this, 'clearElementorCache']);
16 }
17
18 public function register_widgets()
19 {
20 $this->enqueueAssets();
21
22 if (file_exists(BITFORMS_PLUGIN_DIR_PATH . 'includes/Widgets/BitFormElementorWidget.php')) {
23 require_once BITFORMS_PLUGIN_DIR_PATH . 'includes/Widgets/BitFormElementorWidget.php';
24 \Elementor\Plugin::instance()->widgets_manager->register(new BitFormElementorWidget());
25 }
26 }
27
28 private function enqueueAssets()
29 {
30 // add_action('elementor/frontend/after_enqueue_styles', function () {
31 // wp_enqueue_style('bitform-elementor-widget', BITFORMS_ASSET_URI . '/css/bitform-elementor-widget.css', [], '1.0.0');
32 // });
33 }
34
35 public function clearElementorCache()
36 {
37 if (class_exists('\Elementor\Plugin')) {
38 \Elementor\Plugin::$instance->files_manager->clear_cache();
39 }
40 }
41 }
42