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.

$pre = apply_filters( 'pre_reschedule_event', null, $event, $wp_error );

常见问题

FAQs
查看更多 >