pre_unschedule_hook

過濾鉤子
apply_filters( 'pre_unschedule_hook', null, $hook, $wp_error )
引數
  • (null|int|false|WP_Error) $pre Value to return instead. Default null to continue unscheduling the hook.
    Required:
  • (string) $hook Action hook, the execution of which will be unscheduled.
    Required:
  • (bool) $wp_error Whether to return a WP_Error on failure.
    Required:
定義位置
相關勾子
pre_clear_scheduled_hookpre_unschedule_eventpre_schedule_eventpre_reschedule_eventget_schedule
相關方法
wp_unschedule_hookwp_clear_scheduled_hookwp_unschedule_eventwp_reschedule_event_deprecated_hookwp_schedule_event
引入
5.7.0
棄用
-

pre_unschedule_hook: 這個動作在取消cron hook的日程安排之前被觸發。它允許在取消鉤子的計劃前採取一些行動,比如清理鉤子的具體資料。

過濾以preflight或劫持,清除附加到鉤子的所有事件。

返回非空值將縮短正常的非計劃過程,導致函式返回過濾後的值。

對於替換wp-cron的外掛,返回未計劃成功的事件數(如果沒有向鉤子註冊事件,則返回零),如果取消計劃一個或多個事件失敗,則返回false。

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

常見問題

FAQs
檢視更多 >