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.
667* @since 5.7.0 The `$wp_error` parameter was added,and a `WP_Error`object can now be returned.668*669* @param null|int|false|WP_Error$pre Value to return instead.Defaultnull to continue unscheduling the hook.670* @param string$hook Action hook, the execution of which will be unscheduled.671* @param bool$wp_error Whether to return a WP_Error on failure.672*/673$pre=apply_filters('pre_unschedule_hook',null,$hook,$wp_error);674675if(null!==$pre){676if($wp_error&&false===$pre){677returnnewWP_Error(678'pre_unschedule_hook_false',679__('A plugin prevented the hook from being cleared.')
History
Introduced in 5.1.0. Unchanged from 6.7.7 through 7.1.0.