Verified Commit 0b7e0a68 authored by Erick Hitter's avatar Erick Hitter
Browse files

If an event has no callbacks hooked to its action, skip it

Filter is available to bypass this
parent 6770a263
......@@ -65,6 +65,17 @@ class Events extends Singleton {
continue;
}
// Skip events that don't have any callbacks hooked to their actions, unless their execution is requested
if ( false === has_action( $event['action'] ) && ! apply_filters( 'a8c_cron_control_run_event_with_no_callbacks', false, $event ) ) {
if ( false === $event['args']['schedule'] ) {
wp_unschedule_event( $event['timestamp'], $event['action'], $event['args']['args'] );
} else {
wp_reschedule_event( $event['timestamp'], $event['args']['schedule'], $event['action'], $event['args']['args'] );
}
continue;
}
// Necessary data to identify an individual event
// `$event['action']` is hashed to avoid information disclosure
// Core hashes `$event['instance']` for us
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment