函数原型
remove_all_filters( string $hook_name, int|false $priority = false ): true
函数描述
Removes all of the callback functions from a filter hook.
是否弃用
未弃用
函数参数
-
$hook_name
string
Required - The filter to remove callbacks from.
-
$priority
int|false
Optional - The priority number to remove them from.
Default:
false
函数返回值
true Always returns true.
函数位置
File: wp-includes/plugin.php.
函数源码
function remove_all_filters( $hook_name, $priority = false ) {
global $wp_filter;
if ( isset( $wp_filter[ $hook_name ] ) ) {
$wp_filter[ $hook_name ]->remove_all_filters( $priority );
if ( ! $wp_filter[ $hook_name ]->has_filters() ) {
unset( $wp_filter[ $hook_name ] );
}
}
return true;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |

