Add a Five-Minute Cron Schedule
Registers an "every_five_minutes" interval that your own scheduled events can use with wp_schedule_event().
Opens WPIDE on
Code
add_filter( 'cron_schedules', function ( $schedules ) {
if ( ! isset( $schedules['every_five_minutes'] ) ) {
$schedules['every_five_minutes'] = array(
'interval' => 5 * MINUTE_IN_SECONDS,
'display' => 'Every five minutes',
);
}
return $schedules;
} );
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.