current_filter

Retrieve the name of the current filter or action.

Description

(string) current_filter(); 

Returns (string)

Hook name of the current filter or action.


Usage

  1. if ( !function_exists( 'current_filter' ) ) { 
  2. require_once ABSPATH . WPINC . '/plugin.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = current_filter(); 
  7.  

Defined (1)

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

/wp-includes/plugin.php  
  1. function current_filter() { 
  2. global $wp_current_filter; 
  3. return end( $wp_current_filter );