public static function generate_sitemap_for_year($args)
{
$is_partial_or_running = get_option('msm_months_to_process');
$year = $args['year'];
$max_month = 12;
if ($year == date('Y')) {
$max_month = date('n');
}
if (empty($is_partial_or_running)) {
$months = range(1, $max_month);
update_option('msm_months_to_process', $months);
} else {
$months = $is_partial_or_running;
}
$time = time();
$next_month = end($months);
wp_schedule_single_event($time, 'msm_cron_generate_sitemap_for_year_month', array(array('year' => (int) $year, 'month' => (int) $next_month)));
}