Add more intervals to the options in Companion Auto Update

Add more intervals to the options in Companion Auto UpdateCodeerMeneerAdd more intervals to the options in Companion Auto UpdateCompanion Auto Update allows you to change how often certain features will run (Updaters, Notifications etc.) and by default it comes with the options for Hourly, Twice a day, Daily, Weekly and Monthly. But, we are all about giving you full control so if you want to add custom intervals to the plugin you can […]

Companion Auto Update allows you to change how often certain features will run (Updaters, Notifications etc.) and by default it comes with the options for Hourly, Twice a day, Daily, Weekly and Monthly.

But, we are all about giving you full control so if you want to add custom intervals to the plugin you can do this by adding the following code into your themes functions.php file.

function codeermeneer_add_more_intervals( $schedules ) {

     $schedules['six_hours'] = array( 
        'interval' => 21600, // 6 hours in seconds 
        'display' => 'Every 6 hours', 
     ); 

     return $schedules;

}
add_filter( 'cron_schedules', 'codeermeneer_add_more_intervals' );

The number after interval is the time you want in seconds. So 21600 in 6 hours in seconds. display is the name it’ll have in the dashboard.