Skip to content

Instantly share code, notes, and snippets.

@corsonr
Created July 25, 2012 09:11
Show Gist options
  • Save corsonr/3175215 to your computer and use it in GitHub Desktop.
Save corsonr/3175215 to your computer and use it in GitHub Desktop.
Create a custom cron interval
/* ----------------------------------------
* ADD CRON CUSTOM INTERVALS
----------------------------------------- */
add_filter('cron_schedules', 'xxx_cron_every_two_days');
// add a cron interval every 2 days
function xxx_cron_every_two_days( $schedules ) {
$schedules['every_two_days'] = array(
'interval' => 172800, // in seconds
'display' => __('Every two days', 'xxx')
);
return $schedules;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment