Files
wyczarujprezent.pl/modules/leoelements/includes/maintenance.php
2024-10-28 22:14:22 +01:00

86 lines
1.8 KiB
PHP

<?php
/**
* 2007-2022 Leotheme
*
* NOTICE OF LICENSE
*
* LeoElements is module help you can build content for your shop
*
* DISCLAIMER
*
* @author Leotheme <leotheme@gmail.com>
* @copyright 2007-2022 Leotheme
* @license http://leotheme.com - prestashop template provider
*/
namespace LeoElements;
use LeoElements\Leo_Helper;
if ( ! defined( '_PS_VERSION_' ) ) {
exit; // Exit if accessed directly.
}
/**
* Elementor maintenance.
*
* Elementor maintenance handler class is responsible for setting up Elementor
* activation and uninstallation hooks.
*
* @since 1.0.0
*/
class Maintenance {
/**
* Activate Elementor.
*
* Set Elementor activation hook.
*
* Fired by `register_activation_hook` when the plugin is activated.
*
* @since 1.0.0
* @access public
* @static
*/
public static function activation( $network_wide ) {
wp_clear_scheduled_hook( 'elementor/tracker/send_event' );
wp_schedule_event( time(), 'daily', 'elementor/tracker/send_event' );
flush_rewrite_rules();
if ( is_multisite() && $network_wide ) {
return;
}
Leo_Helper::set_transient( 'elementor_activation_redirect', true, LEO_MINUTE_IN_SECONDS );
}
/**
* Uninstall Elementor.
*
* Set Elementor uninstallation hook.
*
* Fired by `register_uninstall_hook` when the plugin is uninstalled.
*
* @since 1.0.0
* @access public
* @static
*/
public static function uninstall() {
wp_clear_scheduled_hook( 'elementor/tracker/send_event' );
}
/**
* Init.
*
* Initialize Elementor Maintenance.
*
* @since 1.0.0
* @access public
* @static
*/
public static function init() {
register_activation_hook( LEOELEMENTS_PLUGIN_BASE, [ __CLASS__, 'activation' ] );
register_uninstall_hook( LEOELEMENTS_PLUGIN_BASE, [ __CLASS__, 'uninstall' ] );
}
}