Filter to override clearing all events attached to the hook.
Description
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). If unscheduling one or more events fails then return either a WP_Error object or false depending on the value of the $wp_error parameter.
Parameters
$prenull|int|false|WP_Error
Value to return instead. Default null to continue unscheduling the hook.
$hookstring
Action hook, the execution of which will be unscheduled.
694* @since 5.7.0 The `$wp_error` parameter was added,and a WP_Error object can now be returned.695*696* @param null|int|false|WP_Error$pre Value to return instead.Defaultnull to continue unscheduling the hook.697* @param string$hook Action hook, the execution of which will be unscheduled.698* @param bool$wp_error Whether to return a WP_Error on failure.699*/700$pre=apply_filters('pre_unschedule_hook',null,$hook,$wp_error);701702if(null!==$pre){703if($wp_error&&false===$pre){704returnnewWP_Error(705'pre_unschedule_hook_false',706__('A plugin prevented the hook from being cleared.')
History
Introduced in 5.1.0. Unchanged from 6.7.7 through 7.1.0.