wp_unschedule_event()注销一个以前预约的定时事件

目录

描述

Unschedules a previously-scheduled cron job.

Note that you need to know the exact time of the next occurrence when scheduled hook was set to run, and the function arguments it was supposed to have, in order to unschedule it. All future occurrences are unscheduled by calling this function.

wp_unschedule_event() 描述

用法

 <?php wp_unschedule_event$timestamp$hook$args ); ?> 

wp_unschedule_event() 用法

参数

$timestamp

(integer) (必填) Timestamp of the next occurrence for the scheduled hook to run. wp_next_scheduled() may be useful.

默认值: None

$hook

(string) (必填) Action hook originally provided, the execution of which will be unscheduled.

默认值: None

$args

(array) (可选) Arguments to pass to the hook's callback function. These arguments are used to uniquely identify the scheduled event, so they must be the same as those used when originally scheduling the event.

默认值: array()

wp_unschedule_event() 参数

历史

添加于 版本: 2.1.0

wp_unschedule_event() 历史

源文件

wp_unschedule_event() 函数的代码位于 wp-includes/cron.php

wp_unschedule_event() 源文件

相关