<?php
/**
 * Register the 'weekly' cron interval for WP-Cron.
 *
 * WordPress does not have a built-in 'weekly' interval.
 * This adds it so the LATAM scheduler can use wp_schedule_event( ..., 'weekly', ... ).
 *
 * @since 2.11.0
 */

if ( ! defined( 'ABSPATH' ) ) exit;

function dba_latam_add_weekly_cron( $schedules ) {
    if ( ! isset( $schedules['weekly'] ) ) {
        $schedules['weekly'] = array(
            'interval' => 604800, // 7 days in seconds
            'display'  => 'Once Weekly (DBA LATAM)',
        );
    }
    return $schedules;
}
add_filter( 'cron_schedules', 'dba_latam_add_weekly_cron' );
