get_name() . '/assets/'; } public function get_widgets() { return []; } public function __construct() { $this->reflection = new \ReflectionClass( $this ); // GOGA // add_action( 'elementor/widgets/widgets_registered', [ $this, 'init_widgets' ] ); add_action( 'elementor/widgets/register', [ $this, 'init_widgets' ] ); } public function init_widgets() { $widget_manager = \Elementor\Plugin::instance()->widgets_manager; foreach ( $this->get_widgets() as $widget ) { $class_name = $this->reflection->getNamespaceName() .'\Widgets\\'. $widget; // $widget_manager->register_widget_type( new $class_name() ); $widget_manager->register( new $class_name() ); } } public function add_component( $id, $instance ) { $this->components[ $id ] = $instance; } public function get_component( $id ) { if ( isset( $this->components[ $id ] ) ) { return $this->components[ $id ]; } return false; } }