wp_clear_scheduled_hook()清除某预订的定时事件的钩子(hook)

目录

描述

Un-schedules all previously-scheduled cron jobs using a particular hook name or a specific combination of hook name and arguments.

wp_clear_scheduled_hook() 描述

用法

 <?php wp_clear_scheduled_hook$hook$args ); ?> 

wp_clear_scheduled_hook() 用法

参数

$hook

(string) (必填) The name of an action hook to execute.

默认值: None

$args

(array) (可选) Arguments to pass to the hook function(s)

默认值: None

wp_clear_scheduled_hook() 参数

示例

Clear a scheduled event

wp_clear_scheduled_hook() 示例

注意

If you created a scheduled job using a hook and arguments you cannot delete it by supplying only the hook. Similarly if you created a set of scheduled jobs that share a hook but have different arguments you cannot delete them using only the hook name, you have to delete them all individually using the hook name and arguments.

wp_clear_scheduled_hook() 注意

历史

添加于 版本: 2.1.0

wp_clear_scheduled_hook() 历史

源文件

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

wp_clear_scheduled_hook() 源文件

相关