add_filter

The WordPress Core add filter function.

Description

add_filter(); 

Usage

  1. if ( !function_exists( 'add_filter' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/noop.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = add_filter(); 
  7.  

Defined (2)

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

/wp-admin/includes/noop.php  
  1. function add_filter() {} 
/wp-includes/plugin.php  
  1. function add_filter( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) { 
  2. global $wp_filter; 
  3. if ( ! isset( $wp_filter[ $tag ] ) ) { 
  4. $wp_filter[ $tag ] = new WP_Hook(); 
  5. $wp_filter[ $tag ]->add_filter( $tag, $function_to_add, $priority, $accepted_args ); 
  6. return true;