As the title states. I checked the documentation but it turns out empty. I have also taken a look at the Message extension which has an expire option for messages, however looking at the source code it seems to rely on “on-demand” user requests which is far from ideal.
Would something like this work conform the Hivepress framework and in which file do i need to put this?
Please send more details about the required functionality, do you mean offers in the Requests extension or messages in the Messages extension? The code seems to be related to offers, but Messages don’t have the Offer model. If possible describe the requirements, e.g. if you mean expiring (hiding) messages/offers I can provide general developer guidance.
Hi, the question is how to deal with cron jobs within the Hivepress framework in general. Does the framework account for cron jobs? I could not find any documentation OR does the code snippet i posted works fine without conflicting with the hivepres framework.
So regardless of the purpose of a particlar cron. In my case it is for expiring best offers made, similar to deleting old messages in the message extension (while not using a cron, but should).
We use Action Scheduler library for this purpose, it’s more reliable than core cron functions in WordPress https://actionscheduler.org/ You can use Action Scheduler functions directly, or use our wrapper than makes it a bit easier, for example:
This way you can schedule one-time or recurring actions, and check them in Tools/Scheduled Actions (for example you can run them manually there, if needed for testing). You can unschedule actions similarly: