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
Unix timestamp (UTC) 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.
514<?php515 * @param null|bool|WP_Error $pre Value to return instead. Default null to continue unscheduling the event.516 * @param int $timestamp Unix timestamp (UTC) for when to run the event.517 * @param string $hook Action hook, the execution of which will be unscheduled.518 * @param array $args Arguments to pass to the hook's callback function.519 * @param bool $wp_error Whether to return a WP_Error on failure.520 */521 $pre = apply_filters( 'pre_unschedule_event', null, $timestamp, $hook, $args, $wp_error );522523 if ( null !== $pre ) {524 if ( $wp_error && false === $pre ) {525 return new WP_Error(526 'pre_unschedule_event_false',527 __( 'A plugin prevented the event from being unscheduled.' )
History
Introduced in 5.1.0. Unchanged from 6.7.7 through 7.1.0.