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。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$pre = apply_filters( 'pre_unschedule_event', null, $timestamp, $hook, $args, $wp_error );
$pre = apply_filters( 'pre_unschedule_event', null, $timestamp, $hook, $args, $wp_error );
$pre = apply_filters( 'pre_unschedule_event', null, $timestamp, $hook, $args, $wp_error );

常見問題

FAQs
檢視更多 >