I am new to cron job.

After reading this article I was able to run a function every hour using wp_schedule_event.

There is a quote on “Don’t forget to clean the scheduler on deactivation” in that page.

I read the documentation of wp_clear_scheduled_hook.

But still I could not understand why we should use wp_clear_scheduled_hook and what it do.

1 Answer
1

If you deactivate the plugin, the scheduled event will still try to run ( and fail ) unless you remove that event from the schedule using wp_clear_scheduled_hook

Leave a Reply

Your email address will not be published. Required fields are marked *