PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 4.0.3
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v4.0.3
4.0.3 4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 341 releases
profile-builder / assets / misc / elementor / class-elementor.php

class-elementor.php in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 4.0.3, at assets/misc/elementor/class-elementor.php

101 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Exit if accessed directly
4 if ( ! defined( 'ABSPATH' ) ) exit;
5
6 use Elementor\Controls_Manager;
7
8 class PB_Elementor {
9 private static $_instance = null;
10 public $locations = array(
11 array(
12 'element' => 'common',
13 'action' => '_section_style',
14 ),
15 array(
16 'element' => 'section',
17 'action' => 'section_advanced',
18 )
19 );
20 public $section_name = 'pb_section_visibility_settings';
21
22 /**
23 * Register plugin action hooks and filters
24 */
25 public function __construct() {
26 // Add category
27 add_action( 'elementor/elements/categories_registered', array( $this, 'add_category' ) );
28
29 // Register widgets
30 add_action( 'elementor/widgets/widgets_registered', array( $this, 'register_widgets' ) );
31 }
32
33 /**
34 *
35 * Ensures only one instance of the class is loaded or can be loaded.
36 *
37 * @return PB_Elementor An instance of the class.
38 */
39 public static function instance() {
40 if ( is_null( self::$_instance ) )
41 self::$_instance = new self();
42
43 return self::$_instance;
44 }
45
46 /**
47 * Include Widgets files
48 */
49 private function include_widgets_files() {
50 require_once(__DIR__ . '/widgets/class-pb-widget-epf.php');
51 require_once(__DIR__ . '/widgets/class-pb-widget-l.php');
52 require_once(__DIR__ . '/widgets/class-pb-widget-rp.php');
53 require_once(__DIR__ . '/widgets/class-pb-widget-rf.php');
54 require_once(__DIR__ . '/widgets/class-pb-widget-ul.php');
55 }
56
57 /**
58 * Register Widgets
59 */
60 public function register_widgets() {
61 $this->include_widgets_files();
62
63 if( version_compare( ELEMENTOR_VERSION, '3.5,', '>=' ) ){
64
65 \Elementor\Plugin::instance()->widgets_manager->register( new PB_Elementor_Edit_Profile_Widget() );
66 \Elementor\Plugin::instance()->widgets_manager->register( new PB_Elementor_Login_Widget() );
67 \Elementor\Plugin::instance()->widgets_manager->register( new PB_Elementor_Recover_Password_Widget() );
68 \Elementor\Plugin::instance()->widgets_manager->register( new PB_Elementor_Register_Widget() );
69
70 if( defined( 'WPPB_PAID_PLUGIN_DIR' ) && file_exists( WPPB_PAID_PLUGIN_DIR . '/add-ons/user-listing/userlisting.php' ) ){
71 \Elementor\Plugin::instance()->widgets_manager->register( new PB_Elementor_User_Listing_Widget() );
72 }
73
74 } else {
75
76 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new PB_Elementor_Edit_Profile_Widget() );
77 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new PB_Elementor_Login_Widget() );
78 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new PB_Elementor_Recover_Password_Widget() );
79 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new PB_Elementor_Register_Widget() );
80
81 if( defined( 'WPPB_PAID_PLUGIN_DIR' ) && file_exists( WPPB_PAID_PLUGIN_DIR . '/add-ons/user-listing/userlisting.php' ) ){
82 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new PB_Elementor_User_Listing_Widget() );
83 }
84
85 }
86 }
87
88 public function add_category( $elements_manager ) {
89 $elements_manager->add_category(
90 'profile-builder',
91 array(
92 'title' => __( 'Profile Builder Forms', 'profile-builder' ),
93 'icon' => 'fa fa-plug',
94 )
95 );
96 }
97 }
98
99 // Instantiate Plugin Class
100 PB_Elementor::instance();
101