数字化技能提升教程,数字化时代生存宝典

数字化百科 / 产品文档 / WordPress:Function Reference/remove action

WordPress:Function Reference/remove action

查看全部产品文档命名空间:WordPress

描述

这个函数移除了附加到某个action hook上的函数。这种方法也可以用来移除复交到某个action hook上的默认函数而且将替换为其它的函数。也看看remove_filter(), add_action() 和 add_filter()。

重点:要移除hook,$function_to_remove 和$priority参数在添加hook的时候,必须匹配。这一点同样适用于filters和actions。移除失败,不会给通知。

例子

这个函数与remove_filter()函数相同。

<?php remove_action($tag, $function_to_remove, $priority, $accepted_args); ?>


参数

返回

(boolean) 函数是否被移除。

True
函数成功地移除了。
False
函数不能够移除。