assets
2 years ago
ajax-select2.php
2 years ago
control-manager.php
2 years ago
image-choose.php
4 years ago
init.php
3 years ago
init.php
45 lines
| 1 | <?php |
| 2 | namespace ShopEngine\Core\Elementor_Controls; |
| 3 | |
| 4 | defined( 'ABSPATH' ) || exit; |
| 5 | |
| 6 | class Init{ |
| 7 | |
| 8 | // instance of all control's base class |
| 9 | public static function get_url(){ |
| 10 | return \ShopEngine::core_url() . 'elementor-controls/'; |
| 11 | } |
| 12 | public static function get_dir(){ |
| 13 | return \ShopEngine::core_dir() . 'elementor-controls/'; |
| 14 | } |
| 15 | |
| 16 | public function __construct() { |
| 17 | |
| 18 | // Includes necessary files |
| 19 | $this->include_files(); |
| 20 | |
| 21 | // Initilizating control hooks |
| 22 | add_action('elementor/controls/controls_registered', array( $this, 'image_choose' ), 12 ); |
| 23 | add_action('elementor/controls/controls_registered', array( $this, 'ajax_select2' ), 12 ); |
| 24 | } |
| 25 | |
| 26 | private function include_files(){ |
| 27 | // Controls_Manager |
| 28 | include_once self::get_dir() . 'control-manager.php'; |
| 29 | |
| 30 | // image choose |
| 31 | include_once self::get_dir() . 'image-choose.php'; |
| 32 | |
| 33 | // ajax select2 |
| 34 | include_once self::get_dir() . 'ajax-select2.php'; |
| 35 | } |
| 36 | |
| 37 | public function image_choose( $controls_manager ) { |
| 38 | $controls_manager->register(new \ShopEngine\Core\Elementor_Controls\Image_Choose()); |
| 39 | } |
| 40 | |
| 41 | public function ajax_select2( $controls_manager ) { |
| 42 | $controls_manager->register(new \ShopEngine\Core\Elementor_Controls\Ajax_Select2()); |
| 43 | } |
| 44 | } |
| 45 |