Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
WP Plugins
Cron-Control
Commits
0b7e0a68
Verified
Commit
0b7e0a68
authored
Dec 12, 2016
by
Erick Hitter
Browse files
If an event has no callbacks hooked to its action, skip it
Filter is available to bypass this
parent
6770a263
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/class-events.php
View file @
0b7e0a68
...
...
@@ -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
...
...
Erick Hitter
@ethitter
mentioned in commit
5c888155
·
Dec 27, 2016
mentioned in commit
5c888155
mentioned in commit 5c8881551ab580d1ae0402dd3a11a7260e0fb606
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment