| 1 |
<?php |
| 2 |
|
| 3 |
namespace JFB_Compatibility\Jet_Engine\Compatibility\Elementor; |
| 4 |
|
| 5 |
class Elementor { |
| 6 |
|
| 7 |
public function init_hooks() { |
| 8 |
// compatibility with 3.7 |
| 9 |
if ( |
| 10 |
defined( 'ELEMENTOR_VERSION' ) && |
| 11 |
version_compare( ELEMENTOR_VERSION, '3.5.0', '>=' ) |
| 12 |
) { |
| 13 |
add_action( 'elementor/widgets/register', array( $this, 'register_widgets' ) ); |
| 14 |
} else { |
| 15 |
add_action( 'elementor/widgets/widgets_registered', array( $this, 'register_widgets' ) ); |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
public function register_widgets( $manager ) { |
| 20 |
// compatibility with 3.7 |
| 21 |
if ( method_exists( $manager, 'register' ) ) { |
| 22 |
$manager->register( new Check_Mark\Widget() ); |
| 23 |
} else { |
| 24 |
$manager->register_widget_type( new Check_Mark\Widget() ); |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
} |
| 29 |
|