1register_activation_hook(__FILE__, 'my_activation');
2
3function my_activation() {
4 if (! wp_next_scheduled ( 'my_hourly_event' )) {
5 wp_schedule_event(time(), 'hourly', 'my_hourly_event');
6 }
7}
8
9add_action('my_hourly_event', 'do_this_hourly');
10
11function do_this_hourly() {
12 // do something every hour
13}
14