schedule_event

过滤钩子
apply_filters( 'schedule_event', $event )
参数
  • (stdClass|false) $event { An object containing an event's data, or boolean false to prevent the event from being scheduled. @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|false $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. Only present for recurring events. }
    Required:
定义位置
相关勾子
pre_schedule_eventpre_reschedule_eventpre_unschedule_eventpre_get_scheduled_eventcron_reschedule_event_error
相关方法
wp_schedule_eventwp_unschedule_eventwp_reschedule_eventwp_get_scheduled_eventwp_schedule_single_eventwp_scheduled_delete
引入
3.1.0
弃用
-

schedule_event: 这个函数用于在WordPress中安排一个事件: 该函数接受参数,指定时间、频率和事件触发时要调用的函数。这可以用来安排经常性的事件,如发布文章、发送电子邮件或更新元数据。

在一个事件被安排之前对其进行修改。

$event = apply_filters( 'schedule_event', $event );

常见问题

FAQs
查看更多 >