Returning a non-null value will short-circuit the normal unscheduling process, causing the function to return the filtered value instead. For plugins replacing wp-cron, return true if the event was successfully unscheduled, false or a WP_Error if not.
Parameters
$prenull|bool|WP_Error
Value to return instead. Default null to continue unscheduling the event.
$timestampint
Timestamp for when to run the event.
$hookstring
Action hook, the execution of which will be unscheduled.
$argsarray
Arguments to pass to the hook's callback function.
487<?php488 * @param null|bool|WP_Error $pre Value to return instead. Default null to continue unscheduling the event.489 * @param int $timestamp Timestamp for when to run the event.490 * @param string $hook Action hook, the execution of which will be unscheduled.491 * @param array $args Arguments to pass to the hook's callback function.492 * @param bool $wp_error Whether to return a WP_Error on failure.493 */494 $pre = apply_filters( 'pre_unschedule_event', null, $timestamp, $hook, $args, $wp_error );495496 if ( null !== $pre ) {497 if ( $wp_error && false === $pre ) {498 return new WP_Error(499 'pre_unschedule_event_false',500 __( 'A plugin prevented the event from being unscheduled.' )
History
Introduced in 5.1.0. Unchanged from 6.7.7 through 7.1.0.