| 1 |
<?php |
| 2 |
defined('ABSPATH') || exit; |
| 3 |
|
| 4 |
final class Elementor_ULTP_Extension { |
| 5 |
|
| 6 |
private static $_instance = null; |
| 7 |
|
| 8 |
public static function instance() { |
| 9 |
if ( is_null( self::$_instance ) ) { |
| 10 |
self::$_instance = new self(); |
| 11 |
} |
| 12 |
return self::$_instance; |
| 13 |
} |
| 14 |
|
| 15 |
public function __construct() { |
| 16 |
//add_action( 'plugins_loaded', array($this, 'init') ); |
| 17 |
$this->init(); |
| 18 |
} |
| 19 |
|
| 20 |
public function init() { |
| 21 |
add_action( 'elementor/widgets/widgets_registered', [ $this, 'register_widgets' ] ); |
| 22 |
add_action( 'elementor/frontend/after_register_scripts', [ $this, 'widget_scripts' ] ); |
| 23 |
} |
| 24 |
|
| 25 |
public function widget_scripts() { |
| 26 |
$init = new \ULTP\Initialization(); |
| 27 |
$init->register_scripts_common(); |
| 28 |
} |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
public function includes() { |
| 33 |
require_once ULTP_PATH.'addons/elementor/Elementor_Widget.php'; |
| 34 |
} |
| 35 |
|
| 36 |
public function register_widgets() { |
| 37 |
$this->includes(); |
| 38 |
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Gutenberg_Post_Blocks_Widget() ); |
| 39 |
} |
| 40 |
} |