| @@ -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 | */ |
| @@ -37,11 +35,9 @@ | ||
| 37 | 35 | flush_rewrite_rules(); |
| 38 | 36 | |
| 39 | 37 | if ( is_multisite() && $network_wide ) { |
| 40 | 38 | static::create_default_kit( |
| 41 | - get_sites( [ | |
| 42 | - 'fields' => 'ids', | |
| 43 | - ] ) | |
| 39 | + get_sites( [ 'fields' => 'ids' ] ) | |
| 44 | 40 | ); |
| 45 | 41 | |
| 46 | 42 | return; |
| 47 | 43 | } |
| @@ -46,31 +42,12 @@ | ||
| 46 | 42 | return; |
| 47 | 43 | } |
| 48 | 44 | |
| 49 | 45 | static::create_default_kit(); |
| 50 | - static::insert_defaults_options(); | |
| 51 | 46 | |
| 52 | 47 | set_transient( 'elementor_activation_redirect', true, MINUTE_IN_SECONDS ); |
| 53 | 48 | } |
| 54 | 49 | |
| 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 | 50 | /** |
| 74 | 51 | * Uninstall Elementor. |
| 75 | 52 | * |
| 76 | 53 | * Set Elementor uninstallation hook. |
| @@ -82,10 +59,8 @@ | ||
| 82 | 59 | * @static |
| 83 | 60 | */ |
| 84 | 61 | public static function uninstall() { |
| 85 | 62 | wp_clear_scheduled_hook( 'elementor/tracker/send_event' ); |
| 86 | - | |
| 87 | - Api::get_uninstalled_data(); | |
| 88 | 63 | } |
| 89 | 64 | |
| 90 | 65 | /** |
| 91 | 66 | * Init. |
| @@ -97,9 +72,8 @@ | ||
| 97 | 72 | * @static |
| 98 | 73 | */ |
| 99 | 74 | public static function init() { |
| 100 | 75 | register_activation_hook( ELEMENTOR_PLUGIN_BASE, [ __CLASS__, 'activation' ] ); |
| 101 | - register_deactivation_hook( ELEMENTOR_PLUGIN_BASE, [ __CLASS__, 'deactivation' ] ); | |
| 102 | 76 | register_uninstall_hook( ELEMENTOR_PLUGIN_BASE, [ __CLASS__, 'uninstall' ] ); |
| 103 | 77 | |
| 104 | 78 | add_action( 'wpmu_new_blog', function ( $site_id ) { |
| 105 | 79 | if ( ! is_plugin_active_for_network( ELEMENTOR_PLUGIN_BASE ) ) { |
| @@ -120,9 +94,9 @@ | ||
| 120 | 94 | |
| 121 | 95 | Manager::create_default_kit(); |
| 122 | 96 | |
| 123 | 97 | restore_current_blog(); |
| 124 | - } | |
| 98 | + }; | |
| 125 | 99 | |
| 126 | 100 | return; |
| 127 | 101 | } |
| 128 | 102 | |