PluginProbe
Elementor Website Builder – more than just a page builder / 3.4.0-dev9
Elementor Website Builder – more than just a page builder v3.4.0-dev9
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/maintenance.php +2 -59 4.1.23.4.0-dev9 View file →
@@ -1,9 +1,8 @@
1 1 <?php
2 2 namespace Elementor;
3 3
4 4 use Elementor\Core\Kits\Manager;
5 -use Elementor\Core\Upgrade\Manager as Upgrade_Manager;
6 5
7 6 if ( ! defined( 'ABSPATH' ) ) {
8 7 exit; // Exit if accessed directly.
9 8 }
@@ -24,9 +23,8 @@
24 23 * Set Elementor activation hook.
25 24 *
26 25 * Fired by `register_activation_hook` when the plugin is activated.
27 26 *
28 - * @param bool $network_wide
29 27 * @since 1.0.0
30 28 * @access public
31 29 * @static
32 30 */
@@ -35,42 +33,17 @@
35 33
36 34 wp_schedule_event( time(), 'daily', 'elementor/tracker/send_event' );
37 35 flush_rewrite_rules();
38 36
37 + Manager::create_default_kit();
38 +
39 39 if ( is_multisite() && $network_wide ) {
40 - static::create_default_kit(
41 - get_sites( [
42 - 'fields' => 'ids',
43 - ] )
44 - );
45 -
46 40 return;
47 41 }
48 42
49 - static::create_default_kit();
50 - static::insert_defaults_options();
51 -
52 43 set_transient( 'elementor_activation_redirect', true, MINUTE_IN_SECONDS );
53 44 }
54 45
55 - public static function insert_defaults_options() {
56 - $history = Upgrade_Manager::get_installs_history();
57 - if ( empty( $history ) ) {
58 - $default_options = [
59 - 'elementor_font_display' => 'swap',
60 - ];
61 - foreach ( $default_options as $option_name => $option_value ) {
62 - if ( \Elementor\Utils::is_empty( get_option( $option_name ) ) ) {
63 - add_option( $option_name, $option_value );
64 - }
65 - }
66 - }
67 - }
68 -
69 - public static function deactivation() {
70 - Api::get_deactivation_data();
71 - }
72 -
73 46 /**
74 47 * Uninstall Elementor.
75 48 *
76 49 * Set Elementor uninstallation hook.
@@ -82,10 +55,8 @@
82 55 * @static
83 56 */
84 57 public static function uninstall() {
85 58 wp_clear_scheduled_hook( 'elementor/tracker/send_event' );
86 -
87 - Api::get_uninstalled_data();
88 59 }
89 60
90 61 /**
91 62 * Init.
@@ -97,35 +68,7 @@
97 68 * @static
98 69 */
99 70 public static function init() {
100 71 register_activation_hook( ELEMENTOR_PLUGIN_BASE, [ __CLASS__, 'activation' ] );
101 - register_deactivation_hook( ELEMENTOR_PLUGIN_BASE, [ __CLASS__, 'deactivation' ] );
102 72 register_uninstall_hook( ELEMENTOR_PLUGIN_BASE, [ __CLASS__, 'uninstall' ] );
103 -
104 - add_action( 'wpmu_new_blog', function ( $site_id ) {
105 - if ( ! is_plugin_active_for_network( ELEMENTOR_PLUGIN_BASE ) ) {
106 - return;
107 - }
108 -
109 - static::create_default_kit( [ $site_id ] );
110 - } );
111 - }
112 -
113 - /**
114 - * @param array $site_ids
115 - */
116 - private static function create_default_kit( array $site_ids = [] ) {
117 - if ( ! empty( $site_ids ) ) {
118 - foreach ( $site_ids as $site_id ) {
119 - switch_to_blog( $site_id );
120 -
121 - Manager::create_default_kit();
122 -
123 - restore_current_blog();
124 - }
125 -
126 - return;
127 - }
128 -
129 - Manager::create_default_kit();
130 73 }
131 74 }