You need to first create the interval for 30 mins. Use filter:
add_filter('cron_schedules','my_cron_schedules', 999 );
function my_cron_schedules($schedules) {
$schedules['thirty_min'] = array(
'interval' => 1800, // Every 30 mins
'display' => __( 'Every 30 mins' ),
);
return $schedules;
}
Then you need to execute the scheduled job:
wp_schedule_event( time(), 'thirty_min', 'your_event_hook' );
Then add the action and the callback function:
add_action('your_event_hook', 'do_this_hourly');
function do_this_hourly() {
wp_mail( '[email protected]', 'Automatic email', 'Automatic scheduled email from WordPress to test cron');
}
you need define('DISABLE_WP_CRON', true);
in your wp-config.php
Then you can schedule your system cron.