remove_all_filters()
Remove all of the hooks from a filter.
No Hooks.
Return
true
. Always returns true.
Usage
remove_all_filters( $hook_name, $priority );
- $hook_name(string) (required)
- The filter to remove callbacks from.
- $priority(int|false)
- The priority number to remove them from.
Default: false
Notes
- Global. WP_Hook[]. $wp_filter Stores all of the filters and actions.
Changelog
Since 2.7.0 | Introduced. |
Code of remove_all_filters() remove all filters WP 5.9.3
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; }