Opened 7 years ago
Closed 7 years ago
#45976 closed defect (bug) (fixed)
Move logic to find next event from `wp_next_scheduled()` to `wp_get_scheduled_event()`.
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.1 | Priority: | normal |
| Severity: | normal | Version: | 5.1 |
| Component: | Cron API | Keywords: | has-patch has-unit-tests |
| Focuses: | Cc: |
Description
The new function for 5.1 wp_get_scheduled_event() accepts the timestamp as an optional argument. If no timestamp is specified the next scheduled event is returned.
If no timestamp is specified, it current makes use of wp_next_scheduled() to determine the timestamp of the next event. This results in running code to get the cron array and determine the key twice.
The logic could be reversed, wp_get_scheduled_event() could determine the next event and wp_next_scheduled() make use of that function if an event is returned.
This will allow the pre_next_scheduled and next_scheduled filters to be deprecated. If the change is made prior to WP 5.1's release, they can be removed.
Attachments (3)
Change History (9)
#5
@
7 years ago
This makes sense and 45976.3.diff looks good. Tested well in my sandbox.
In 45976.2.diff
wp_get_scheduled_event()&replaced with&&inside condition