php - Catching error messages and states from wp cron
Is it possible to catch data from wp cron? ex. I set a function to run via wp cron, I want to get the following:
- Errors/Exceptions that have been thrown inside the function if there are any so I can present it to the end user
- Success/Failure status, the function returns certain values to indicate success and failure of operation, I want to get that also from the function that is running via wp cron to display the operation status
Is this even possible? if so, any help is much appreciated.
To debug cron in WordPress, add your function to
wp_cron functiongets executed in this action hook. You will see errors, if any, printed when you reload your frontend page