Current path: home/webdevt/www/cryptoimpot.fr/wp-content/plugins/divi-contact-form-helper/app/Base/
?? Go up: /home/webdevt/www/cryptoimpot.fr/wp-content/plugins/divi-contact-form-helper/app
<?php
namespace KS_PAC_DCFH\Base;
if (!defined('ABSPATH')) {
exit;
}
class Deactivate
{
public static function deactivate($network_wide): void
{
if ($network_wide && function_exists('is_multisite') && is_multisite()) {
$sites = get_sites();
foreach ($sites as $site) {
switch_to_blog($site->blog_id);
self::delete_crons();
restore_current_blog();
}
} else {
self::delete_crons();
}
}
public static function delete_crons(): void
{
$crons = [
'dcfh_entries_backup_daily',
'dcfh_entries_backup_hourly',
'dcfh_entries_backup_twicedaily',
'dcfh_entries_backup_weekly',
'dcfh_entries_backup_monthly',
'dcfh_delete_tmp_files',
];
foreach ($crons as $cron) {
if (wp_next_scheduled($cron)) {
wp_clear_scheduled_hook($cron);
}
}
}
}