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 the number of events successfully unscheduled (zero if no events were registered with the hook) or false or a WP_Error if unscheduling one or more events fails.
Parameters
$prenull|int|false|WP_Error
Value to return instead. Default null to continue unscheduling the event.
$hookstring
Action hook, the execution of which will be unscheduled.
$argsarray
Arguments to pass to the hook's callback function.
604<?php605 *606 * @param null|int|false|WP_Error $pre Value to return instead. Default null to continue unscheduling the event.607 * @param string $hook Action hook, the execution of which will be unscheduled.608 * @param array $args Arguments to pass to the hook's callback function.609 * @param bool $wp_error Whether to return a WP_Error on failure.610 */611 $pre = apply_filters( 'pre_clear_scheduled_hook', null, $hook, $args, $wp_error );612613 if ( null !== $pre ) {614 if ( $wp_error && false === $pre ) {615 return new WP_Error(616 'pre_clear_scheduled_hook_false',617 __( 'A plugin prevented the hook from being cleared.' )
History
Introduced in 5.1.0. Unchanged from 6.7.7 through 7.1.0.