[wp-trac] [WordPress Trac] #49961: Expose the reason for failures that occur within WP-Cron functions
WordPress Trac
noreply at wordpress.org
Mon Apr 20 17:06:20 UTC 2020
#49961: Expose the reason for failures that occur within WP-Cron functions
-------------------------+-----------------------------
Reporter: johnbillion | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Cron API | Version: 5.1
Severity: normal | Keywords: 2nd-opinion
Focuses: |
-------------------------+-----------------------------
Since WordPress 5.1, the various WP-Cron related functions
(`wp_schedule_event()` etc) [https://make.wordpress.org/core/2019/01/23
/cron-api-changes-in-wordpress-5-1/ now return meaningful return values],
but this still doesn't expose the underlying reason for failure.
My WP Crontrol plugin regularly gets support requests from users who are
managing cron events but getting a generic error message. It would be
useful if core exposed the underlying problem so that anything that calls
`wp_schedule_event()`, `wp_unschedule_event()` etc can provide a
meaningful error message to the end user.
I see two potential approaches:
1. Add an optional `$wp_error` parameter to these functions, similar to
`wp_update_post()`, `wp_set_comment_status()` etc, and return a meaningful
error when one occurs.
2. Trigger an action containing the error details, similar to
`http_api_debug`, which can be hooked into before calling the cron
functions.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49961>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list