开发者

Debugging cron tasks in WordPress

开发者 https://www.devze.com 2023-01-30 02:35 出处:网络
How could I debug cron task run by internal cron functions? My cron task is not firing and I suppose some functions are not declared yet when cron hook takes place.

How could I debug cron task run by internal cron functions? My cron task is not firing and I suppose some functions are not declared yet when cron hook takes place.

It would be great if I can store the errors into some log file? Any ideas? Thanks.

I used Core Control plugin to see if everything is all right. The my开发者_运维技巧_task_hook and hooked function too, the "due time" is changing...so something else must be wrong.


I found the wp-cron dashboard plugin http://wordpress.org/extend/plugins/wp-cron-dashboard/ very helpful. Using it I was able to see what cron tasks were working or not.

I also found that the docs on the cron functions weren't very clear. When setting up a wp cron task make sure you add the function as an action using add_action only then can you run wp_schedule_event on the task.

Good luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号