PluginProbe
Borderless – Addons and Templates for Elementor / 1.2.0
Borderless – Addons and Templates for Elementor v1.2.0
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 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.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 All 78 releases
borderless / modules / elementor / elementor.php

elementor.php in Borderless – Addons and Templates for Elementor 1.2.0, at modules/elementor/elementor.php

96 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // don't load directly
4 defined( 'ABSPATH' ) || exit;
5
6 final class Borderless_Elementor {
7
8 private static $_instance = null;
9
10 public static function instance() {
11
12 if ( is_null( self::$_instance ) ) {
13 self::$_instance = new self();
14 }
15 return self::$_instance;
16
17 }
18
19 public function __construct() {
20
21 add_action( 'plugins_loaded', [ $this, 'on_plugins_loaded' ] );
22
23 }
24
25 public function on_plugins_loaded() {
26
27 if ( $this->is_compatible() ) {
28 add_action( 'elementor/init', [ $this, 'init' ] );
29 }
30
31 }
32
33 public function is_compatible() {
34
35 return true;
36
37 }
38
39 public function init() {
40
41 wp_register_style(
42 'font-awesome-5',
43 ELEMENTOR_ASSETS_URL . 'lib/font-awesome/css/all.min.css',
44 false,
45 BORDERLESS__VERSION
46 );
47
48 // Add Plugin actions
49 add_action( 'elementor/widgets/widgets_registered', [ $this, 'init_widgets' ] );
50 //add_action( 'elementor/controls/controls_registered', [ $this, 'init_controls' ] );
51 add_action( 'elementor/elements/categories_registered', [ $this, 'register_borderless_elementor_category' ] );
52
53 }
54
55 public function init_widgets() {
56
57 // Include Widget files
58 require_once('helper.php');
59 require_once('widgets/contact-form-7.php');
60 //require_once('widgets/posts.php');
61 require_once('widgets/team-member.php');
62 require_once('widgets/testimonial.php');
63
64 // Register widget
65 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Borderless\Widgets\Contact_Form_7() );
66 //\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Borderless\Widgets\Posts() );
67 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Borderless\Widgets\Team_Member() );
68 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Borderless\Widgets\Testimonial() );
69
70 }
71
72 /*
73 public function init_controls() {
74
75 // Include Control files
76 require_once( __DIR__ . '/controls/test-control.php' );
77
78 // Register control
79 \Elementor\Plugin::$instance->controls_manager->register_control( 'control-type-', new \Test_Control() );
80
81 }
82 */
83
84 public function register_borderless_elementor_category( $elements_manager ) {
85 $elements_manager->add_category(
86 'borderless',
87 [
88 'title' => __( 'Borderless', 'borderless' ),
89 'icon' => 'fa fa-plug',
90 ]
91 );
92 }
93
94 }
95
96 Borderless_Elementor::instance();