plugins - Cron job shedules replace?

I was watching this: Wp_Schedule_Event every day at specific time and im wondering if I do the following will it replace

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.

Share Improve this question edited Oct 9, 2019 at 12:19 butlerblog 5,1213 gold badges28 silver badges44 bronze badges asked Oct 9, 2019 at 10:01 Alexis GarciaAlexis Garcia 1032 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

This 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745095855a4610972.html

相关推荐

  • plugins - Cron job shedules replace?

    I was watching this: Wp_Schedule_Event every day at specific time and im wondering if I do the following will it replace

    18小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信