I was watching this: Wp_Schedule_Event every day at specific time and im wondering if I do the following will it replace all my schedules?
function myprefix_custom_cron_schedule( $schedules ) {
$schedules['every_six_hours'] = array(
'interval' => 21600, // Every 6 hours
'display' => __( 'Every 6 hours' ),
);
return $schedules;
}
add_filter( 'cron_schedules', 'myprefix_custom_cron_schedule' );
I have more cron jobs running but if I do this will it replace the timer? For example, I have 1 running 1 time every hour, will it be replaced? Just wondering if it will mess up the cron_shedules
.
I was watching this: Wp_Schedule_Event every day at specific time and im wondering if I do the following will it replace all my schedules?
function myprefix_custom_cron_schedule( $schedules ) {
$schedules['every_six_hours'] = array(
'interval' => 21600, // Every 6 hours
'display' => __( 'Every 6 hours' ),
);
return $schedules;
}
add_filter( 'cron_schedules', 'myprefix_custom_cron_schedule' );
I have more cron jobs running but if I do this will it replace the timer? For example, I have 1 running 1 time every hour, will it be replaced? Just wondering if it will mess up the cron_shedules
.
1 Answer
Reset to default 0This won't affect your existing scheduled Cron events, as they already have a schedule interval set. It will only add a new custom schedule interval that will be available for new ones. So long as you are adding to the $schedules
array and returning it (which you are) then it will all be fine.