pre_get_scheduled_event

過濾鉤子
apply_filters( 'pre_get_scheduled_event', null, $hook, $args, $timestamp )
引數
  • (null|false|object) $pre Value to return instead. Default null to continue retrieving the event.
    Required:
  • (string) $hook Action hook of the event.
    Required:
  • (array) $args Array containing each separate argument to pass to the hook's callback function. Although not passed to a callback, these arguments are used to uniquely identify the event.
    Required:
  • (int|null) $timestamp Unix timestamp (UTC) of the event. Null to retrieve next scheduled event.
    Required:
定義位置
相關勾子
pre_schedule_eventpre_reschedule_eventpre_unschedule_eventschedule_eventget_schedule
相關方法
wp_get_scheduled_eventwp_reschedule_eventwp_schedule_eventwp_unschedule_eventwp_get_schedulewp_get_schedules
引入
5.1.0
棄用
-

pre_get_scheduled_event – 這個鉤子在預定事件被檢索到之前被呼叫。開發者可以使用這個鉤子來修改事件查詢或提供一個基於鉤子名稱或時間的自定義事件。

篩選以preflight 或劫持檢索計劃事件。

返回非空值將使正常過程短路,而返回過濾後的值。

如果事件不存在,則返回false,否則應返回事件物件。

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

常見問題

FAQs
檢視更多 >