从指定的操作挂钩中删除函数。
原型
remove_action( string $tag, callable $function_to_remove, int $priority = 10 )
描述
此函数删除附加到指定操作挂钩的函数。此方法可用于删除附加到特定筛选器挂钩的默认函数,并可能用替换替换它们。
参数
$tag
(string)
(Required)
挂钩要删除的函数的动作挂钩。
$function_to_remove
(callable)
(Required)
应删除的函数的名称。
$priority
(int)
(Optional)
功能的优先级。
返回值
(bool)
是否删除该功能。
源文件
路径:wp-includes/plugin.php
<?php
...
function remove_action( $tag, $function_to_remove, $priority = 10 ) {
return remove_filter( $tag, $function_to_remove, $priority );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/remove_action/