函数原型
remove_action( string $hook_name, callable|string|array $callback, int $priority = 10 ): bool
函数描述
Removes a callback function from an action hook.
是否弃用
未弃用
函数参数
-
$hook_name
string
Required - The action hook to which the function to be removed is hooked.
-
$callback
callable|string|array
Required - The name of the function which should be removed.
This function can be called unconditionally to speculatively remove a callback that may or may not exist. -
$priority
int
Optional - The exact priority used when adding the original action callback.
Default:
10
函数返回值
bool Whether the function is removed.
函数位置
File: wp-includes/plugin.php.
函数源码
function remove_action( $hook_name, $callback, $priority = 10 ) {
return remove_filter( $hook_name, $callback, $priority );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 1.2.0 | Introduced. |

