remove_all_actions()删除一个动作的所有钩子

目录

描述

Remove all of the hooks from an action.

remove_all_actions() 描述

用法

<?php remove_all_actions$tag$priority ?>

remove_all_actions() 用法

参数

$tag

(string) (必填) The action to remove hooks from.

默认值: None

$priority

(integer) (可选) The priority number to remove them from.

默认值: false

remove_all_actions() 参数

返回值

(boolean) 

True when finished.

remove_all_actions() 返回值

注意

You can't call this function from within the hook you would like to remove 动作s from. For example adding an 动作 to wp_footer that calls remove_all_actions('wp_footer') will cause an infinite loop condition because the while loop suddenly doesn't have a next value. In WordPress 3.8.1 you'll get a warning message like:

Warning: next() expects parameter 1 to be array, null given in wp-includes/plugin.php on line 431

You'll just need to hook into a hook that's called before the hook you wish to clear is called.

remove_all_actions() 注意

历史

添加于 版本: 2.7

remove_all_actions() 历史

源文件

remove_all_actions() 函数的代码位于 wp-includes/plugin.php.

remove_all_actions() 源文件

相关