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
if ( !function_exists( 'current_filter' ) ) { require_once ABSPATH . WPINC . '/plugin.php'; } // NOTICE! Understand what this does before running. $result = current_filter();
Defined (1)
The function is defined in the following location(s).
- /wp-includes/plugin.php
- function current_filter() {
- global $wp_current_filter;
- return end( $wp_current_filter );
- }