-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathplugin.php
More file actions
35 lines (26 loc) · 739 Bytes
/
plugin.php
File metadata and controls
35 lines (26 loc) · 739 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
<?php
namespace ElementorPopup;
use ElementorPopup\Widgets\ElementorPopup;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class ElementorPopupPlugin {
/**
* 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 ElementorPopup() );
}
}
new ElementorPopupPlugin();