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.
577<?php578 *579 * @param null|int|false|WP_Error $pre Value to return instead. Default null to continue unscheduling the event.580 * @param string $hook Action hook, the execution of which will be unscheduled.581 * @param array $args Arguments to pass to the hook's callback function.582 * @param bool $wp_error Whether to return a WP_Error on failure.583 */584 $pre = apply_filters( 'pre_clear_scheduled_hook', null, $hook, $args, $wp_error );585586 if ( null !== $pre ) {587 if ( $wp_error && false === $pre ) {588 return new WP_Error(589 'pre_clear_scheduled_hook_false',590 __( 'A plugin prevented the hook from being cleared.' )
History
Introduced in 5.1.0. Unchanged from 6.7.7 through 7.1.0.