# bit-form/2.21.4/includes/Widgets/RegisterBitFormElementorWidget.php

Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator &amp; Custom Form Builder, version 2.21.4. 42 lines.

- Page: https://pluginprobe.com/plugins/bit-form/2.21.4/code/includes/Widgets/RegisterBitFormElementorWidget.php
- Raw: https://pluginprobe.com/plugins/bit-form/2.21.4/raw/includes/Widgets/RegisterBitFormElementorWidget.php
- Modified: 2025-05-20T11:50:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/bit-form/2.21.4/code/includes/Widgets/RegisterBitFormElementorWidget.php#L10-L20`.

```php
<?php

namespace BitCode\BitForm\Widgets;

if (!defined('ABSPATH')) {
  exit;
}

class RegisterBitFormElementorWidget
{
  public function __construct()
  {
    add_action('elementor/widgets/register', [$this, 'register_widgets']);
    add_action('elementor/editor/after_save', [$this, 'clearElementorCache']);
    add_action('update_option_elementor_css', [$this, 'clearElementorCache']);
  }

  public function register_widgets()
  {
    $this->enqueueAssets();

    if (file_exists(BITFORMS_PLUGIN_DIR_PATH . 'includes/Widgets/BitFormElementorWidget.php')) {
      require_once BITFORMS_PLUGIN_DIR_PATH . 'includes/Widgets/BitFormElementorWidget.php';
      \Elementor\Plugin::instance()->widgets_manager->register(new BitFormElementorWidget());
    }
  }

  private function enqueueAssets()
  {
    // add_action('elementor/frontend/after_enqueue_styles', function () {
    //   wp_enqueue_style('bitform-elementor-widget', BITFORMS_ASSET_URI . '/css/bitform-elementor-widget.css', [], '1.0.0');
    // });
  }

  public function clearElementorCache()
  {
    if (class_exists('\Elementor\Plugin')) {
      \Elementor\Plugin::$instance->files_manager->clear_cache();
    }
  }
}

```
