I´m testing my cron task.
I´m not sure but it seems to be the effect of a previous code.
So, I´m wondering when you modify you call function and you run now your cron task (I´m using WP Control) and you load a page, the code applied is not the most recent code you upload.
It´s right or wrong ?
What happens excalty, call functions are cached ?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
What happens excalty, call functions are cached ?
They do not get cached.
When you schedule a cron job, it stores a record in the database to trigger a hook with certain parameters at a time/date. No code is cached.
So when that time comes, the code is loaded and run from the disk as it is at that time, not when it was scheduled.
For example, if I schedule a cron job for tomorrow that writes the word “hello” to a file, then immediately change the function to instead send an email, when the cron job runs an email is sent.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0