WP Cron intervals multiple times a day?

Question

I would like to run a custom interval for a cronjob where it runs every day at 5 minutes after 6am, 10am, 2pm and 6pm.

The timing for this on a crontab would be 5 6,10,14,18 * * *

However I’m stuck at working out how I would make this work within WPCron.

I can’t use server level crontab due to hosting the site on WPEngine where they don’t allow server level access. However they have a handy function called ‘WP Engine Alternate Cron’ whcih is a true cron that runs every minute on the minute, checking for and activating scheduled events.

Could I create 4 separate intervals to run once every 24 hours at a specific time of day?

Eg. wp_schedule_event( strtotime( '2019-10-22 10:00:00' ), '5min', 'my_scheduled_event' );

Or is there something else that can be done?

0
JVAN 4 years 2019-10-21T17:51:47-05:00 0 Answers 81 views 0

Leave an answer

Browse
Browse