add_category( 'opalestate-pro', [ 'title' => esc_html__( 'Opal Estate', 'opalestate-pro' ), 'icon' => 'fa fa-plug', ] ); } /** * Includes */ public function includes() { require OPALESTATE_PLUGIN_DIR . 'inc/vendors/elementor/class-opalestate-elementor-widget-base.php'; } /** * Init Widgets * * Include widgets files and register them * * @access public */ public function register_widgets() { $this->includes(); $widget_paths = glob( OPALESTATE_PLUGIN_DIR . 'inc/vendors/elementor/widgets/*.php' ); if ( $widget_paths ) { foreach ( $widget_paths as $path ) { require_once $path; $class_name = ucfirst( str_replace("-","_", basename( $path, '.php' ) ) ).'_Elementor_Widget'; if( class_exists($class_name) ){ \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new $class_name() ); } } } } } Opalestate_Elementor_Extended::instance();