PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.0.8
JetFormBuilder — Dynamic Blocks Form Builder v3.0.8
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 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / includes / compatibility / elementor / widget-controller.php
jetformbuilder / includes / compatibility / elementor Last commit date
widgets 3 years ago elementor.php 3 years ago widget-controller.php 3 years ago
widget-controller.php
89 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Compatibility\Elementor;
5
6
7 use Elementor\Widget_Base;
8 use Jet_Form_Builder\Compatibility\Elementor\Widgets\Form;
9
10 class Widget_Controller {
11
12 private $types;
13
14 public function __construct() {
15 add_action( 'elementor/init', array( $this, 'init_widgets' ) );
16 add_action( 'elementor/editor/after_enqueue_styles', array( $this, 'editor_styles' ) );
17 add_action( 'elementor/preview/enqueue_scripts', array( $this, 'enqueue_form_assets' ) );
18 add_action( 'elementor/elements/categories_registered', array( $this, 'register_category' ) );
19
20 // compatibility with 3.7
21 if (
22 defined( 'ELEMENTOR_VERSION' ) &&
23 version_compare( ELEMENTOR_VERSION, '3.5.0', '>=' )
24 ) {
25 add_action( 'elementor/widgets/register', array( $this, 'register_widgets' ) );
26 } else {
27 add_action( 'elementor/widgets/widgets_registered', array( $this, 'register_widgets' ) );
28 }
29 }
30
31 public function init_widgets() {
32 $this->types = array(
33 new Form(),
34 );
35
36 foreach ( $this->types as $type ) {
37 $type->init_hooks();
38 }
39 }
40
41 public function enqueue_form_assets() {
42 wp_enqueue_style( 'jet-form-builder-frontend' );
43 }
44
45 /**
46 * Register category for elementor if not exists
47 *
48 * @return void
49 */
50 public function register_category() {
51
52 $elements_manager = \Elementor\Plugin::instance()->elements_manager;
53
54 $elements_manager->add_category(
55 'jet-form-builder',
56 array(
57 'title' => esc_html__( 'JetFormBuilder', 'jet-form-builder' ),
58 'icon' => 'font',
59 )
60 );
61 }
62
63 /**
64 * Enqueue editor styles
65 *
66 * @return void
67 */
68 public function editor_styles() {
69 wp_enqueue_style(
70 'jet-form-builder-icons',
71 jet_form_builder()->plugin_url( 'assets/css/icons.css' ),
72 array(),
73 jet_form_builder()->get_version()
74 );
75 }
76
77
78 public function register_widgets( $manager ) {
79 foreach ( $this->types as $widget ) {
80 // compatibility with 3.7
81 if ( method_exists( $manager, 'register' ) ) {
82 $manager->register( $widget );
83 } else {
84 $manager->register_widget_type( $widget );
85 }
86 }
87 }
88
89 }