remove_all_filters

Remove all of the hooks from a filter.

Description

remove_all_filters( (string) $tag, (bool) $priority = false ); 

Parameters (2)

0. $tag (string)
The filter to remove hooks from.
1. $priority — Optional. (bool) => false
The priority number to remove. Default false.

Usage

  1. if ( !function_exists( 'remove_all_filters' ) ) { 
  2. require_once ABSPATH . WPINC . '/plugin.php'; 
  3.  
  4. // The filter to remove hooks from. 
  5. $tag = ''; 
  6.  
  7. // Optional. The priority number to remove. Default false. 
  8. $priority = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = remove_all_filters($tag, $priority); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/plugin.php  
  1. function remove_all_filters( $tag, $priority = false ) { 
  2. global $wp_filter; 
  3.  
  4. if ( isset( $wp_filter[ $tag ]) ) { 
  5. $wp_filter[ $tag ]->remove_all_filters( $priority ); 
  6. if ( ! $wp_filter[ $tag ]->has_filters() ) { 
  7. unset( $wp_filter[ $tag ] ); 
  8.  
  9. return true;