Files
Testing/tbb/wp-content/plugins/mailchimp-for-wp/includes/admin/migrations/3.0.3-usage-tracking-schedule.php
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

30 lines
719 B
PHP

<?php
defined('ABSPATH') or exit;
$options = (array) get_option('mc4wp', array());
if (empty($options['allow_usage_tracking'])) {
return;
}
// usage tracking is enabled, reschedule it so it uses new cron schedule.
// make sure 'monthly' cron schedule is registered
/**
* @ignore
*/
function _mc4wp_303_add_monthly_cron_schedule($schedules)
{
$schedules['monthly'] = array(
'interval' => 30 * DAY_IN_SECONDS,
'display' => 'Once a month'
);
return $schedules;
}
add_filter('cron_schedules', '_mc4wp_303_add_monthly_cron_schedule', 1);
// reschedule usage tracking event
wp_clear_scheduled_hook('mc4wp_usage_tracking');
wp_schedule_event(time(), 'monthly', 'mc4wp_usage_tracking');