How to execute existing WP Cron programmatically
When you register a scheduled event for WordPress’ cron, the 3rd argument is a hook name: wp_schedule_event( time(), ‘hourly’, ‘my_hourly_event’ ); And you add a function to run on this hook with add_action(): add_action( ‘my_hourly_event’, ‘do_this_hourly’ ); This will cause do_this_hourly() to run whenever the scheduled event runs. This works because when the scheduled time … Read more