Opened 8 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: | peterwilsoncc | Owned by: | peterwilsoncc |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.1 |
| Component: | Cron API | Version: | 5.1 |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 45976.2.diff
wp_get_scheduled_event()&replaced with&&inside condition