Skip to content

Instantly share code, notes, and snippets.

@donini
Created September 7, 2019 21:17
Show Gist options
  • Save donini/5d6a3733a0768d402ac672fc30ab3c9b to your computer and use it in GitHub Desktop.
Save donini/5d6a3733a0768d402ac672fc30ab3c9b to your computer and use it in GitHub Desktop.
<?php
add_filter( 'cron_schedules', 'add_cron_interval' );
function add_cron_interval( $intervals ) {
/* Add new cron interval */
$intervals['one_minute'] = array(
'interval' => 60, /* It's not recomended cron schedules with less then 15 minutes */
'display' => esc_html__( 'Every minute' ),
);
/* Remove cron interval */
unset( $intervals['one_minute'] );
return $intervals;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment