pre_unschedule_event

过滤钩子
apply_filters( 'pre_unschedule_event', null, $timestamp, $hook, $args, $wp_error )
参数
  • (null|bool|WP_Error) $pre Value to return instead. Default null to continue unscheduling the event.
    Required:
  • (int) $timestamp Timestamp for when to run the event.
    Required:
  • (string) $hook Action hook, the execution of which will be unscheduled.
    Required:
  • (array) $args Arguments to pass to the hook's callback function.
    Required:
  • (bool) $wp_error Whether to return a WP_Error on failure.
    Required:
定义位置
相关勾子
pre_schedule_eventpre_reschedule_eventpre_get_scheduled_eventschedule_eventpre_unschedule_hook
相关方法
wp_unschedule_eventwp_reschedule_eventwp_schedule_eventwp_get_scheduled_eventwp_schedule_single_eventwp_scheduled_delete
引入
5.7.0
弃用
-

pre_unschedule_event: 这个动作在取消cron事件的日程安排之前被触发。它允许在事件取消计划前采取一些行动,比如清理事件的具体数据。

过滤以preflight或劫持未计划的事件。

返回非空值将缩短正常的非计划过程,导致函数返回过滤后的值。

对于替换wp-cron的插件,如果事件被成功调度,则返回true,否则返回false或WP_Erro。

$pre = apply_filters( 'pre_unschedule_event', null, $timestamp, $hook, $args, $wp_error );

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2026-01-29 13:09:46

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: