remove_all_filters( string $hook_name, int|false $priority = false )
Removes all of the callback functions from a filter hook.
Parameters
- $hook_name
-
(string) (Required) The filter to remove callbacks from.
- $priority
-
(int|false) (Optional) The priority number to remove them from.
Default value: false
Return
(true) Always returns true.
Source
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;
} Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |
© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/remove_all_filters