[wp-trac] [WordPress Trac] #52655: Ability to Change the wp_next_scheduled() function output.
WordPress Trac
noreply at wordpress.org
Thu Feb 25 15:04:10 UTC 2021
#52655: Ability to Change the wp_next_scheduled() function output.
-------------------------+-----------------------------
Reporter: infosatech | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 5.6.2
Severity: normal | Keywords: has-patch
Focuses: |
-------------------------+-----------------------------
If I want to replace WP Cron with the Action Scheduler Library it is
necessary to change the wp_next_scheduled() function output by overriding
it using a filter to use as_next_scheduled_action() function.
{{{
function wp_next_scheduled( $hook, $args = array() ) {
$next_event = wp_get_scheduled_event( $hook, $args );
if ( ! $next_event ) {
return false;
}
return apply_filters( 'wp_next_scheduled', $next_event->timestamp,
$next_event, $hook, $args );
}
}}}
If we use 'pre_get_scheduled_event' filter, it will also override the
default Cron functions. So that I think 'wp_next_scheduled' is necessary.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52655>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list