I am trying to create custom interval for cron schedule with given user input, but its not working.
Here is the code:
add_filter( 'cron_schedules', 'custom_cron_schedule' );
function custom_cron_schedule( $schedules,$int ) {
$schedules['custom'] = array(
'interval' => $int, // user input integer in second
'display' => __( 'Custom Interval' ),
);
return $schedules;
}
I tried to look at custom schedule via _get_cron_array()
and found that interval is missing I also checked $int
, it has 36000
.
So what am I missing here OR am I not allowed to use arguments in this filter?