Current Path : /storage/v11800/affypharma/public_html/wp-content/plugins/bdthemes-element-pack/base/ |
Linux v11800 5.3.0-1023-aws #25~18.04.1-Ubuntu SMP Fri Jun 5 15:19:18 UTC 2020 aarch64
|
Current File : /storage/v11800/affypharma/public_html/wp-content/plugins/bdthemes-element-pack/base/element-pack-module-base.php |
<?php
namespace ElementPack\Base;
use Elementor\Core\Base\Module;
use ElementPack\Element_Pack_Loader;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
abstract class Element_Pack_Module_Base extends Module {
public function get_widgets() {
return [];
}
public function __construct() {
add_action( 'elementor/widgets/widgets_registered', [ $this, 'init_widgets' ] );
}
public function init_widgets() {
$widget_manager = Element_Pack_Loader::elementor()->widgets_manager;
foreach ( $this->get_widgets() as $widget ) {
$class_name = $this->get_reflection()->getNamespaceName() . '\Widgets\\' . $widget;
$widget_manager->register_widget_type( new $class_name() );
}
}
}