kirki.php
53 lines
| 1 | <?php |
| 2 | defined( 'ABSPATH' ) || exit; |
| 3 | |
| 4 | use TutorLMSKirki\Backend; |
| 5 | use TutorLMSKirki\Frontend; |
| 6 | use TutorLMSKirki\Helper; |
| 7 | |
| 8 | // Prevent loading when the old Kirki plugin is active. |
| 9 | if ( ! class_exists( 'KirkiProMain' ) ) { |
| 10 | return; |
| 11 | } |
| 12 | |
| 13 | require_once __DIR__ . '/vendor/autoload.php'; |
| 14 | require_once __DIR__ . '../../../classes/Input.php'; // Input helper class not loaded, thats why we need to include it manually. |
| 15 | |
| 16 | /** |
| 17 | * Kirki element source and filter hook will use using this prefix. |
| 18 | * this prefix value is same as javascript APP_PREFIX variable. |
| 19 | */ |
| 20 | define( 'TDE_APP_PREFIX', 'tde' ); |
| 21 | define( 'TDE_APP_VERSION', '1.0.2' ); |
| 22 | define( 'TDE_BASE', home_url() ); |
| 23 | define( 'TDE_PLUGIN_ROOT_BASE', plugin_dir_url( __FILE__ ) ); |
| 24 | |
| 25 | /** |
| 26 | * Tutor Kirki Elements |
| 27 | * |
| 28 | * @package tutor-kirki-elements |
| 29 | */ |
| 30 | class TutorKirkiElements { |
| 31 | /** |
| 32 | * Initializes a singleton instance |
| 33 | * |
| 34 | * @return \Kirki |
| 35 | */ |
| 36 | public static function init() { |
| 37 | static $instance = false; |
| 38 | |
| 39 | if ( ! $instance ) { |
| 40 | $instance = new self(); |
| 41 | } |
| 42 | |
| 43 | register_activation_hook( __FILE__, array( new Helper(), 't_d_e_activate' ) ); |
| 44 | |
| 45 | new Backend(); |
| 46 | new Frontend(); |
| 47 | |
| 48 | return $instance; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | TutorKirkiElements::init(); |
| 53 |