[wp-trac] [WordPress Trac] #40161: Wrong documented or coded 'schedule_event' filter
WordPress Trac
noreply at wordpress.org
Fri Mar 17 13:22:13 UTC 2017
#40161: Wrong documented or coded 'schedule_event' filter
-----------------------------------------+------------------------------
Reporter: esemlabel | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Cron API | Version:
Severity: normal | Resolution:
Keywords: has-patch reporter-feedback | Focuses:
-----------------------------------------+------------------------------
Changes (by swissspidy):
* keywords: has-patch => has-patch reporter-feedback
* version: trunk =>
* type: defect (bug) => enhancement
Comment:
I cannot seem to understand the issue you're facing with this.
Developers would do something like this:
{{{#!php
function my_filter_event( $event ) {
if ( $event && 'foo' === $event->hook ) {
// Prevent this specific event from running.
return false;
}
return $event;
}
add_filter( 'schedule_event', 'my_filter_event' );
}}}
Of course `$event` should be an object, but you can return `false` to
short-circuit this. If that's confusing, we can look at updating the
inline documentation.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40161#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list