-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathessential_adons_elementor.php
executable file
·120 lines (109 loc) · 3.27 KB
/
essential_adons_elementor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
/**
* Plugin Name: Essential Addons for Elementor
* Description: The Essential plugin you install after Elementor! Packed with 100+ stunning elements like Data Table, Event Calendar, Filterable Gallery, WooCommerce.
* Plugin URI: https://essential-addons.com/
* Author: WPDeveloper
* Version: 6.1.0
* Author URI: https://wpdeveloper.com/
* Text Domain: essential-addons-for-elementor-lite
* Domain Path: /languages
*
* WC tested up to: 9.5
* Elementor tested up to: 3.26
* Elementor Pro tested up to: 3.26
*/
if (!defined('ABSPATH')) {
exit;
} // Exit if accessed directly
/**
* Defining plugin constants.
*
* @since 3.0.0
*/
define('EAEL_PLUGIN_FILE', __FILE__);
define('EAEL_PLUGIN_BASENAME', plugin_basename(__FILE__));
define('EAEL_PLUGIN_PATH', trailingslashit(plugin_dir_path(__FILE__)));
define('EAEL_PLUGIN_URL', trailingslashit(plugins_url('/', __FILE__)));
define('EAEL_PLUGIN_VERSION', '6.1.0');
define('EAEL_ASSET_PATH', wp_upload_dir()['basedir'] . '/essential-addons-elementor');
define('EAEL_ASSET_URL', wp_upload_dir()['baseurl'] . '/essential-addons-elementor');
/**
* Including composer autoloader globally.
*
* @since 3.0.0
*/
require_once EAEL_PLUGIN_PATH . 'autoload.php';
/**
* Including plugin config.
*
* @since 3.0.0
*/
$GLOBALS['eael_config'] = require_once EAEL_PLUGIN_PATH . 'config.php';
/**
* Run plugin after all others plugins
*
* @since 3.0.0
*/
add_action( 'plugins_loaded', function () {
if ( class_exists( '\Essential_Addons_Elementor\Classes\Bootstrap' ) ) {
\Essential_Addons_Elementor\Classes\Bootstrap::instance();
}
} );
/**
* Plugin migrator
*
* @since v3.0.0
*/
add_action('wp_loaded', function () {
$migration = new \Essential_Addons_Elementor\Classes\Migration;
$migration->migrator();
});
/**
* Activation hook
*
* @since v3.0.0
*/
register_activation_hook(__FILE__, function () {
$migration = new \Essential_Addons_Elementor\Classes\Migration;
$migration->plugin_activation_hook();
});
/**
* Deactivation hook
*
* @since v3.0.0
*/
register_deactivation_hook(__FILE__, function () {
$migration = new \Essential_Addons_Elementor\Classes\Migration;
$migration->plugin_deactivation_hook();
});
/**
* Upgrade hook
*
* @since v3.0.0
*/
add_action( 'upgrader_process_complete', function ( $upgrader_object, $options ) {
if ( class_exists( '\Essential_Addons_Elementor\Classes\Migration' ) ) {
$migration = new \Essential_Addons_Elementor\Classes\Migration;
$migration->plugin_upgrade_hook( $upgrader_object, $options );
}
}, 10, 2 );
add_action( 'wp_loaded', function () {
$setup_wizard = get_option( 'eael_setup_wizard' );
if ( $setup_wizard == 'redirect' ) {
\Essential_Addons_Elementor\Classes\WPDeveloper_Setup_Wizard::redirect();
}
if ( $setup_wizard == 'init' ) {
new \Essential_Addons_Elementor\Classes\WPDeveloper_Setup_Wizard();
}
} );
/**
* WooCommerce HPOS Support
*
* @since v5.8.2
*/
add_action( 'before_woocommerce_init', function() {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
}
} );