register( new ADDOSHVI_Elementor_Widget() ); } /** * Elementor < 3.5 used a different hook/signature ('widgets_registered' * with no $widgets_manager argument passed to legacy-style callbacks). * Skip entirely on modern Elementor, which fires 'elementor/widgets/register'. */ public function register_widget_legacy() { if ( ! defined( 'ELEMENTOR_VERSION' ) || version_compare( ELEMENTOR_VERSION, '3.5.0', '>=' ) ) { return; } if ( ! class_exists( '\Elementor\Plugin' ) ) { return; } require_once ADDOSHVI_PLUGIN_DIR . 'includes/elementor/class-svp-elementor-widget.php'; \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ADDOSHVI_Elementor_Widget() ); } }