25% off ProSNIPC25OFF

Register Custom WP-Cron Intervals

Adds "Every 15 Minutes" and "Twice Daily" schedule intervals to the WP-Cron system for use with wp_schedule_event().

PHPby SnipCraft
php
<?php
if ( ! function_exists( 'scseed_add_cron_intervals' ) ) {
    function scseed_add_cron_intervals( $schedules ) {
        $schedules['scseed_every_15_minutes'] = array(
            'interval' => 15 * MINUTE_IN_SECONDS,
            'display'  => __( 'Every 15 Minutes', 'scseed' ),
        );
        $schedules['scseed_twice_daily'] = array(
            'interval' => 12 * HOUR_IN_SECONDS,
            'display'  => __( 'Twice Daily (Every 12 Hours)', 'scseed' ),
        );
        return $schedules;
    }
    add_filter( 'cron_schedules', 'scseed_add_cron_intervals' );
}
#automation#cron#performance#scheduling