最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - Cron job shedules replace?

programmeradmin2浏览0评论

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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论