<?php
function schedule_name_cron_schedule($schedules){
if(!isset($schedules['schedule_name'])){
$schedules['schedule_name'] = array(
'interval' => 60*60*24*3, // interval in seconds
'display' => 'interval name'); // display text for example "Every three days"
}
return $schedules;
}
add_filter('cron_schedules','schedule_name_cron_schedule');
if(!wp_next_scheduled( 'schedule_function_name' )) {
// if function doesn't exist for certain schedule, create it
wp_schedule_event( time(), 'schedule_name', 'schedule_function_name' );
}
add_action( 'schedule_function_name', 'function_name_which_describes_what_the_cron_does' );
function function_name_which_describes_what_the_cron_does() {
// do something cool here, for example send an email
wp_mail('recipient', 'subject', 'content');
}