pre_reschedule_event

過濾鉤子
apply_filters( 'pre_reschedule_event', null, $event, $wp_error )
引數
  • (null|bool|WP_Error) $pre Value to return instead. Default null to continue adding the event.
    Required:
  • (stdClass) $event { An object containing an event's data. @type string $hook Action hook to execute when the event is run. @type int $timestamp Unix timestamp (UTC) for when to next run the event. @type string $schedule How often the event should subsequently recur. @type array $args Array containing each separate argument to pass to the hook's callback function. @type int $interval The interval time in seconds for the schedule. }
    Required:
  • (bool) $wp_error Whether to return a WP_Error on failure.
    Required:
定義位置
相關勾子
pre_schedule_eventpre_unschedule_eventpre_get_scheduled_eventschedule_eventcron_reschedule_event_error
相關方法
wp_reschedule_eventwp_schedule_eventwp_unschedule_eventwp_get_scheduled_eventwp_schedule_single_eventwp_scheduled_delete
引入
5.7.0
棄用
-

pre_reschedule_event。這個過濾器用於過濾傳遞給wp_reschedule_event函式的引數。這允許開發者修改傳遞給函式的引數,例如改變預定事件的重複性。

過濾以preflight或劫持重複事件的重新安排。

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

對於替換wp-cron的外掛,如果成功重新安排了事件,則返回true,否則返回false或WP_Error.

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

常見問題

FAQs
檢視更多 >