Create new schedule times via cron_schedules

If you have ever scheduled an event in WordPress  wp_schedule_event(time(), 'hourly', 'my_schedule_hook', $args); function you should know that schedule time is

  • hourly
  • twicedaily
  • daily

In order to create your own schedule time, you can use cron_schedules filter hook.

📆 Add weekly and monthly and 🕕 30 minutes intervals.

Using custom time intervals.

Check out the example plugin cron-schedule-example. In this Plugin, posts are added after every 5 minutes, when the number of posts reaches to 10 then cron schedule is cleared. This plugin runs on activation and clears schedule on deactivation.

About The Author

Leave A Comment?