-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplugin.php
More file actions
43 lines (34 loc) · 925 Bytes
/
Copy pathplugin.php
File metadata and controls
43 lines (34 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace ElementorModal;
use ElementorModal\Widgets\ElementorModal;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class ElementorModalPlugin {
/**
* Plugin constructor.
*/
public function __construct() {
$this->add_actions();
}
private function add_actions() {
add_action( 'elementor/widgets/widgets_registered', [ $this, 'on_widgets_registered' ] );
}
public function on_widgets_registered() {
$this->includes();
$this->register_widget();
}
private function includes() {
require __DIR__ . '/widgets/popup.php';
}
private function register_widget() {
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ElementorModal() );
\Elementor\Plugin::instance()->elements_manager->add_category(
'norewp-elements',
[
'title' => 'NoreWP\'s Elementor Modules',
'icon' => 'fa fa-plug'
],
1
);
}
}
new ElementorModalPlugin();