Ok, let's say I want to give the user the ability to schedule a wp cron event every X minutes. Now, let's say I want X to be anywhere from 10 to 525600 (minutes in a year).
What I'm seeing is an utterly stupid way to handle cron events through the $schedules array. If I understand correctly, I have to add a custom schedule to the array for every single different event time the end user wants. For example:
add_filter( 'cron_schedules', function ( $schedules ) {
$schedules['twelve_minutes'] = array(
'interval' => 12,
'display' => __( 'Twelve Minutes' )
);
return $schedules;
} );
Please tell me there's some way to schedule an event with a custom time without having to add 525,590 unique intervals to the $schedules array.
wp_schedule_event
function.