| 1 |
<?php |
| 2 |
|
| 3 |
// don't load directly |
| 4 |
defined( 'ABSPATH' ) || exit; |
| 5 |
|
| 6 |
/*-----------------------------------------------------------------------------------*/ |
| 7 |
/* *. Borderless Category |
| 8 |
/*-----------------------------------------------------------------------------------*/ |
| 9 |
|
| 10 |
function add_elementor_widget_categories( $elements_manager ) { |
| 11 |
$elements_manager->add_category( |
| 12 |
'borderless', |
| 13 |
[ |
| 14 |
'title' => __( 'Borderless', 'borderless' ), |
| 15 |
'icon' => 'fa fa-plug', |
| 16 |
] |
| 17 |
); |
| 18 |
} |
| 19 |
add_action( 'elementor/elements/categories_registered', 'add_elementor_widget_categories' ); |
| 20 |
|
| 21 |
|
| 22 |
/*-----------------------------------------------------------------------------------*/ |
| 23 |
/* *. Borderless Widgets |
| 24 |
/*-----------------------------------------------------------------------------------*/ |
| 25 |
|
| 26 |
class Borderless_Widgets { |
| 27 |
|
| 28 |
protected static $instance = null; |
| 29 |
|
| 30 |
public static function get_instance() { |
| 31 |
if ( ! isset( static::$instance ) ) { |
| 32 |
static::$instance = new static; |
| 33 |
} |
| 34 |
|
| 35 |
return static::$instance; |
| 36 |
} |
| 37 |
|
| 38 |
protected function __construct() { |
| 39 |
include('helper.php'); |
| 40 |
include('widgets/contact-form-7.php'); |
| 41 |
include('widgets/team-member.php'); |
| 42 |
add_action( 'elementor/widgets/widgets_registered', [ $this, 'register_widgets' ] ); |
| 43 |
} |
| 44 |
|
| 45 |
public function register_widgets() { |
| 46 |
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Borderless\Widgets\Contact_Form_7() ); |
| 47 |
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Borderless\Widgets\Team_Member() ); |
| 48 |
} |
| 49 |
|
| 50 |
} |
| 51 |
|
| 52 |
add_action( 'init', 'my_elementor_init' ); |
| 53 |
function my_elementor_init() { |
| 54 |
Borderless_Widgets::get_instance(); |
| 55 |
} |