WordPress:Function Reference/remove action
Description
描述
This function removes a function attached to a specified action hook. This method can be used to remove default functions attached to a specific action hook and possibly replace them with a substitute. See also remove_filter(), add_action() and add_filter().
这个函数移除了附加到某个action hook上的函数。这种方法也可以用来移除复交到某个action hook上的默认函数而且将替换为其它的函数。也看看remove_filter(), add_action() 和 add_filter()。
Important: To remove a hook, the $function_to_remove and $priority arguments must match when the hook was added. This goes for both filters and actions. No warning will be given on removal failure.
重点:要移除hook,$function_to_remove 和$priority参数在添加hook的时候,必须匹配。这一点同样适用于filters和actions。移除失败,不会给通知。
Example
例子
This function is identical to the remove_filter() function.
这个函数与remove_filter()函数相同。
<?php remove_action($tag, $function_to_remove, $priority, $accepted_args); ?>
<?php remove_action($tag, $function_to_remove, $priority, $accepted_args); ?>
Parameters
参数
Return
返回
(boolean) 函数是否被移除。
- True
- The function was successfully removed.
- False
- The function could not be removed.
- True
- 函数成功地移除了。
- False
- 函数不能够移除。