init(); } /** * Initialize the plugin * * Load the plugin only after Elementor (and other plugins) are loaded. * Checks for basic plugin requirements, if one check fail don't continue, * if all check have passed load the files required to run the plugin. * * Fired by `plugins_loaded` action hook. * * @since 1.0.0 * * @access public */ public function init() { // Add Plugin actions add_action( 'elementor/widgets/register', [ $this, 'init_widgets' ] ); add_action( 'elementor/controls/register', [ $this, 'init_controls' ] ); $this->init_includes(); } /** * Init Widgets * * Include widgets files and register them * * @since 1.0.0 * * @access public */ public function init_widgets() { // Include Widget files require_once( __DIR__ . '/widgets/loop-item.php' ); // Register widget \Elementor\Plugin::instance()->widgets_manager->register( new \Ele_Custom_Loop_Item_Widget() ); } /** * Init Includes * * Include the necessary files and register them * * @since 1.0.0 * * @access public */ public function init_includes() { /* foreach (glob( __DIR__ . "/includes/*.php") as $filename) { require_once( $filename ); }*/ } /** * Init Controls * * Include controls files and register them * * @since 1.0.0 * * @access public */ public function init_controls() { // Include Control files // require_once( __DIR__ . '/controls/test-control.php' ); // Register control // \Elementor\Plugin::$instance->controls_manager->register_control( 'control-type-', new \Test_Control() ); } } \Ele_Custom_Loop_Item::instance();