本文档介绍了测试和管理 WordPress 中 WP-Cron 的多种方法,包括使用 WP-CLI 命令、插件以及核心函数来查看和操作定时任务。
Cron jobs can be tested using WP-CLI. It offers commands like wp cron event list and wp cron event run {job name}. Check the documentation for more details.
_get_cron_array()The _get_cron_array() function returns an array of all currently scheduled cron events. Use this function if you need to inspect the raw list of events.
wp_get_schedules()The wp_get_schedules() function returns an array of available event recurrence schedules. Use this function if you need to inspect the raw list of available schedules.