I am having a small tour page that uses built-in cron jobs (wp-cron) to sync tours and sessions via an API every 4 hours and until here everything is perfect.
Now, what I am trying to achieve now is to also and "forcefully" execute this specific cronjob (regardless of it’s schedule) when being on a specific page, e.g. Thank you page (not Woocommerce).
What’s the best way to have this achieved? Some expert help would be greatly appreciated, thank you.
2
Answers
I have been left with the doubt, are you using the native Cron job of your server or the wp-cron of WordPress?
I think you can try by using admin_init hooks and check the page id or url then run the execute function.